Debian Codegraph @

man/devices.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/devices.R
3 \name{devices}
4 \alias{devices}
5 \alias{with_dev}
6 \alias{with_device}
7 \alias{with_bmp}
8 \alias{local_bmp}
9 \alias{with_cairo_pdf}
10 \alias{local_cairo_pdf}
11 \alias{with_cairo_ps}
12 \alias{local_cairo_ps}
13 \alias{with_pdf}
14 \alias{local_pdf}
15 \alias{with_postscript}
16 \alias{local_postscript}
17 \alias{with_svg}
18 \alias{local_svg}
19 \alias{with_tiff}
20 \alias{local_tiff}
21 \alias{with_xfig}
22 \alias{local_xfig}
23 \alias{with_png}
24 \alias{local_png}
25 \alias{with_jpeg}
26 \alias{local_jpeg}
27 \title{Graphics devices}
28 \usage{
29 with_bmp(new, code, ...)
30
31 local_bmp(new, ..., .local_envir = parent.frame())
32
33 with_cairo_pdf(new, code, ...)
34
35 local_cairo_pdf(new, ..., .local_envir = parent.frame())
36
37 with_cairo_ps(new, code, ...)
38
39 local_cairo_ps(new, ..., .local_envir = parent.frame())
40
41 with_pdf(new, code, ...)
42
43 local_pdf(new, ..., .local_envir = parent.frame())
44
45 with_postscript(new, code, ...)
46
47 local_postscript(new, ..., .local_envir = parent.frame())
48
49 with_svg(new, code, ...)
50
51 local_svg(new, ..., .local_envir = parent.frame())
52
53 with_tiff(new, code, ...)
54
55 local_tiff(new, ..., .local_envir = parent.frame())
56
57 with_xfig(new, code, ...)
58
59 local_xfig(new, ..., .local_envir = parent.frame())
60
61 with_png(new, code, ...)
62
63 local_png(new, ..., .local_envir = parent.frame())
64
65 with_jpeg(new, code, ...)
66
67 local_jpeg(new, ..., .local_envir = parent.frame())
68 }
69 \arguments{
70 \item{new}{\code{[named character]}\cr New graphics device}
71
72 \item{code}{\code{[any]}\cr Code to execute in the temporary environment}
73
74 \item{...}{Additional arguments passed to the graphics device.}
75
76 \item{.local_envir}{\verb{[environment]}\cr The environment to use for scoping.}
77 }
78 \value{
79 \code{[any]}\cr The results of the evaluation of the \code{code}
80 argument.
81 }
82 \description{
83 Temporarily use a graphics device.
84 }
85 \details{
86 \itemize{
87 \item \code{with_bmp()} and \code{local_bmp()} wrap around \code{\link[grDevices:png]{grDevices::bmp()}}.
88 \item \code{with_cairo_pdf()} and \code{local_cairo_pdf()} wrap around \code{\link[grDevices:cairo]{grDevices::cairo_pdf()}}.
89 \item \code{with_cairo_ps()} and \code{local_cairo_ps()} wrap around \code{\link[grDevices:cairo]{grDevices::cairo_ps()}}.
90 \item \code{with_pdf()} and \code{local_pdf()} wrap around \code{\link[grDevices:pdf]{grDevices::pdf()}}.
91 \item \code{with_postscript()} and \code{local_postscript()} wrap around \code{\link[grDevices:postscript]{grDevices::postscript()}}.
92 \item \code{with_svg()} and \code{local_svg()} wrap around \code{\link[grDevices:cairo]{grDevices::svg()}}.
93 \item \code{with_tiff()} and \code{local_tiff()} wrap around \code{\link[grDevices:png]{grDevices::tiff()}}.
94 \item \code{with_xfig()} and \code{local_xfig()} wrap around \code{\link[grDevices:xfig]{grDevices::xfig()}}.
95 \item \code{with_png()} and \code{local_png()} wrap around \code{\link[grDevices:png]{grDevices::png()}}.
96 \item \code{with_jpeg()} and \code{local_jpeg()} wrap around \code{\link[grDevices:png]{grDevices::jpeg()}}.
97 }
98 }
99 \section{Functions}{
100 \itemize{
101 \item \code{with_bmp()}: BMP device
102
103 \item \code{with_cairo_pdf()}: CAIRO_PDF device
104
105 \item \code{with_cairo_ps()}: CAIRO_PS device
106
107 \item \code{with_pdf()}: PDF device
108
109 \item \code{with_postscript()}: POSTSCRIPT device
110
111 \item \code{with_svg()}: SVG device
112
113 \item \code{with_tiff()}: TIFF device
114
115 \item \code{with_xfig()}: XFIG device
116
117 \item \code{with_png()}: PNG device
118
119 \item \code{with_jpeg()}: JPEG device
120
121 }}
122 \examples{
123 # dimensions are in inches
124 with_pdf(file.path(tempdir(), "test.pdf"), width = 7, height = 5,
125 plot(runif(5))
126 )
127
128 # dimensions are in pixels
129 with_png(file.path(tempdir(), "test.png"), width = 800, height = 600,
130 plot(runif(5))
131 )
132 }
133 \seealso{
134 \code{\link{withr}} for examples
135
136 \code{\link[grDevices]{Devices}}
137 }