Title: | Plot Raster Graphics in PDF Files |
Version: | 0.1.1 |
Description: | The ability to plot raster graphics in PDF files can be useful when one needs multi-page documents, but the plots contain so many individual elements that (the usual) use of vector graphics results in inconveniently large file sizes. Internally, the package plots each individual page as a PNG, and then combines them in one PDF file. |
License: | MIT + file LICENSE |
Imports: | methods, png |
Suggests: | covr, lintr, pkgdown, ragg, testthat |
URL: | https://ilarischeinin.github.io/rasterpdf, https://github.com/ilarischeinin/rasterpdf |
BugReports: | https://github.com/ilarischeinin/rasterpdf/issues |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.0.0 |
NeedsCompilation: | no |
Packaged: | 2019-11-22 17:06:02 UTC; ischeini |
Author: | Ilari Scheinin |
Maintainer: | Ilari Scheinin <ilari.scheinin+rasterpdf@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2019-11-22 18:30:03 UTC |
Shut down a graphics device
Description
Please see the manual page for grDevices::dev.off()
. Package rasterpdf
overrides the function in order to provide functionality of raster_pdf()
,
but internally calls grDevices::dev.off()
.
Usage
dev.off(which = grDevices::dev.cur())
Arguments
which |
An integer that specifies the device number. Default is the current device. |
See Also
Examples
raster_pdf(tempfile(fileext = ".pdf"))
plot(iris)
dev.off()
Raster PDF graphics device (with PNG pages)
Description
Open a graphics device for raster PDF files. Internally, a PNG device is used for the individual pages, which are then combined into one PDF file.
Usage
raster_pdf(
filename = "Rplots.pdf",
width = NULL,
height = NULL,
units = NULL,
res = NULL,
png_function = NULL,
pdf_function = NULL,
...
)
agg_pdf(...)
Arguments
filename |
A character string of the output file name. |
width |
Page width. If |
height |
Page height. If |
units |
The units in which |
res |
Resolution in ppi. If |
png_function |
A PNG device function. If |
pdf_function |
A PDF device function. If |
... |
Further arguments passed through to the PNG device function
specified in |
Details
The ability to plot raster graphics in PDF files can be useful when one needs
multipage documents, but the plots contain so many individual elements that
use of vector graphics (with grDevices::pdf()
) results in inconveniently
large file sizes
Internally, the function plots each individual page in a PNG file, which are
then combined into one PDF file when dev.off()
is called. By default, the
PNGs are generated with grDevices::png()
, but another device function can
also be specified. The PDF is by default generated with
grDevices::cairo_pdf()
if it is available, and
grDevices::pdf()
otherwise. Again, it is possible to specify another PDF
device function.
agg_pdf(...)
is shorthand for
raster_pdf(..., png_function = ragg::agg_png)
.
See Also
grDevices::pdf()
, grDevices::cairo_pdf()
,
grDevices::png()
, ragg::agg_png()
Examples
raster_pdf(tempfile(fileext = ".pdf"))
plot(iris)
dev.off()
rasterpdf: Plot Raster Graphics in PDFs.
Description
rasterpdf is an R package to plot raster graphics in PDF files. This can be
useful when one needs multipage documents, but the plots contain so many
individual elements that use of vector graphics (with grDevices::pdf()
)
results in inconveniently large file sizes. Internally, rasterpdf plots each
individual page as a PNG, and then combines them in one PDF file.
Functions
raster_pdf()
Opens a raster graphics PDF device.
dev.off()
Closes a graphics device.