pdf_png: Graph output file management

Description Usage Arguments Value Author(s) See Also Examples

Description

Graph output file management. Do not forget to close the graphics device again with code like if(pdf|png) dev.off()\.cr PDFs are vector graphics and nicely zoomable and thus the default for vis_discharge.
PNGs are pixely raster graphics but may have a much smaller file size. They are better suited for spatial grids and thus the default in vis_asc and vis_dem.

Usage

1
2
pdf_png(file, pdf = FALSE, png = FALSE, overwrite = FALSE, width = 7,
  height = 5, units = "in", res = 500, ...)

Arguments

file

filename without pdf/png extension. Unless overwrite=TRUE, files will not be overwritten. _1 will be appended instead, see newFilename.

pdf

Write plots created after calling this function into PDF instead of R graphics device? DEFAULT: FALSE

png

Ditto for PNG. Set either to TRUE, but not both (will stop with an error). DEFAULT: FALSE

overwrite

Logical: overwrite existing file? DEFAULT: FALSE (_n appended in filename)

width, height

Graph dimensions. DEFAULT: 7x5 inches

units, res

Graph quality arguments passed only to png. DEFAULT: inches ("in"), 500 ppi

...

Further arguments passed to pdf or png

Value

Nothing, but opens a pdf or png device if either pdf or png is TRUE.

Author(s)

Berry Boessenkool, berry-b@gmx.de, Feb 2017

See Also

pdf, png

Examples

1
2
3
4
5
pdf_png("dummyplot", pdf=TRUE)
plot(cumsum(rnorm(1000)), type="l")
dev.off()

unlink("dummyplot.pdf")

brry/mhmVis documentation built on May 13, 2019, 7:53 a.m.