Redirect the output of a plot function to a PNG file

output_to_png(FUN, args, filename, size = unlist(kwb.utils::DIN.A4()),
  units = "cm", res = 300, ..., dbg = TRUE)

Arguments

FUN

plot function to be called

args

list of arguments given to the plot function FUN

filename

full path to the PNG file to be written. The extension ".png" will be automatically appended if it is omitted

size

vector containing the width (first element) and height (second element) of the plot, as passed to png. By default the dimensions of a DIN A4 page are used.

units

units as passed to png

res

resolution as passed to png

further arguments passed to png

dbg

if TRUE a message "Plotting to <filename>..." is shown