gdd_export_plot: Export the Degree-Day Plot as PNG

View source: R/gdd_export.R

gdd_export_plotR Documentation

Export the Degree-Day Plot as PNG

Description

Draws the degree-day figure of a "gdd" object on a png device ('ragg' when available, otherwise png) and writes it to disk - the standalone counterpart of plot_file = in gdd_analyze, usable on an existing fit at any time. All plot options of gdd_plot are supported.

Usage

gdd_export_plot(
  x,
  file = "gdd_plot.png",
  group = NULL,
  show_C = TRUE,
  show_Topt = TRUE,
  title = NULL,
  sub = NULL,
  xlab = NULL,
  ylab = NULL,
  family = NULL,
  width = 10.67,
  height = 6,
  units = c("in", "cm", "px"),
  res = 150,
  ...
)

Arguments

x

A "gdd" object returned by [gdd_calc()] or [gdd_analyze()].

file

Output png path.

group, show_C, show_Topt, title, sub, xlab, ylab, family

Plot options, see gdd_plot; NULL (default) keeps the function defaults.

width, height, units, res

Physical size and resolution of the png; the composition is identical at every resolution, res only adds pixels (same semantics as in gdd_analyze).

...

Further arguments passed to gdd_plot.

Value

Invisibly, file.

Examples


f <- system.file("extdata", "gdd_example.csv", package = "insectecol")
fit <- gdd_calc(gdd_read(f), by = "stage")
gdd_export_plot(fit, tempfile(fileext = ".png"),
                title = "Developmental rate vs temperature")


insectecol documentation built on Oct. 5, 2026, 5:08 p.m.