Writes a plot to disk. The format is taken from the file extension:
Arguments
- plot
An
orb_specobject.- file
Output path. The extension selects the format.
- width, height
Logical size in pixels (the drawing is laid out at this size, then rendered at
dpi).- dpi
Resolution for raster formats. 96 is screen resolution; 300 is a common print requirement; 600 gives very high resolution output.
- interactive
For
.htmland.svg, embed interactive behaviour.
Details
.svgVector output from the built-in SVG writer. Being a vector format it is resolution independent - it stays sharp at any size.
.htmlA self-contained interactive page (see
orb_interactive())..pdfVector output through R's PDF device.
.png,.tiff,.jpegRaster output at the requested
dpi; use 300 or more for print.
Examples
p <- orb(mtcars, x = wt, y = mpg, colour = cyl) + orb_points()
f <- tempfile(fileext = ".png")
orb_save(p, f, dpi = 300)
file.exists(f)
#> [1] TRUE
unlink(f)