-
Notifications
You must be signed in to change notification settings - Fork 1
/
cairo_ps.html
183 lines (145 loc) · 5.84 KB
/
cairo_ps.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Cairo-based SVG, PDF and PostScript Graphics Devices</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="R.css">
</head><body>
<table width="100%" summary="page for cairo"><tr><td>cairo</td><td align="right">R Documentation</td></tr></table>
<h2>Cairo-based SVG, PDF and PostScript Graphics Devices</h2>
<h3>Description</h3>
<p>Graphics devices for SVG, PDF and PostScript graphics files.
</p>
<h3>Usage</h3>
<pre>
svg(filename = if(onefile) "Rplots.svg" else "Rplot%03d.svg",
width = 7, height = 7, pointsize = 12,
onefile = FALSE, family = "sans", bg = "white",
antialias = c("default", "none", "gray", "subpixel"))
cairo_pdf(filename = if(onefile) "Rplots.pdf" else "Rplot%03d.pdf",
width = 7, height = 7, pointsize = 12,
onefile = FALSE, family = "sans", bg = "white",
antialias = c("default", "none", "gray", "subpixel"))
cairo_ps(filename = if(onefile) "Rplots.ps" else "Rplot%03d.ps",
width = 7, height = 7, pointsize = 12,
onefile = FALSE, family = "sans", bg = "white",
antialias = c("default", "none", "gray", "subpixel"))
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>filename</code></td>
<td>
<p>the name of the output file.
The page number is substituted if a C integer format is included in
the character string, as in the default. (The result must be less
than <code>PATH_MAX</code> characters long, and may be truncated if not.
See <code>postscript</code> for further details.) Tilde expansion
is performed where supported by the platform.</p>
</td></tr>
<tr valign="top"><td><code>width</code></td>
<td>
<p>the width of the device in inches.</p>
</td></tr>
<tr valign="top"><td><code>height</code></td>
<td>
<p>the height of the device in inches.</p>
</td></tr>
<tr valign="top"><td><code>pointsize</code></td>
<td>
<p>the default pointsize of plotted text (in big points).</p>
</td></tr>
<tr valign="top"><td><code>onefile</code></td>
<td>
<p>should all plots appear in one file or in separate files?</p>
</td></tr>
<tr valign="top"><td><code>family</code></td>
<td>
<p>one of the device-independent font families,
<code>"sans"</code>, <code>"serif"</code> and <code>"mono"</code>, or a character
string specify a font family to be searched for in a
system-dependent way.
See, the ‘Cairo fonts’ section in the help for <code>X11</code>.
</p>
</td></tr>
<tr valign="top"><td><code>bg</code></td>
<td>
<p>the initial background colour: can be overridden by setting
par("bg").</p>
</td></tr>
<tr valign="top"><td><code>antialias</code></td>
<td>
<p>string, the type of anti-aliasing (if any) to be used;
defaults to <code>"default"</code>.</p>
</td></tr>
</table>
<h3>Details</h3>
<p>SVG (Scalar Vector Graphics) is a W3C standard for vector graphics.
See <a href="http://www.w3.org/Graphics/SVG/">http://www.w3.org/Graphics/SVG/</a>. The output is SVG version
1.1 for <code>onefile = FALSE</code> (the default), otherwise SVG 1.2. (Very few
SVG viewers are capable of displaying multi-page SVG files.) Although
this only requires cairo >= 1.2, the output produced by cairo 1.2.4
(in Centos/RHEL 5) is incorrect.
</p>
<p>Note that unlike <code>postscript</code> and <code>pdf</code>,
<code>cairo_pdf</code> and <code>cairo_ps</code> sometimes record <EM>bitmaps</EM>
and not vector graphics: a resolution of 72dpi is used. On the other
hand, they can (on suitable platforms) include a much wider range of
UTF-8 glyphs, and embed the fonts used.
</p>
<p>The output produced by <code>cairo_ps(onefile = FALSE)</code> will be
encapsulated postscript on a platform with cairo >= 1.6.
</p>
<p><font face="Courier New,Courier" color="#666666"><b>R</b></font> can be compiled without support for any of these
devices: this will be reported if you attempt to use them on a system
where they are not supported. They all require cairo version 1.2 or
later.
</p>
<p>If you plot more than one page on one of these devices and do not
include something like <code>%d</code> for the sequence number in
<code>file</code> (or set <code>onefile=TRUE</code>) the file will contain the
last page plotted.
</p>
<p>There is full support of transparency, but using this is one of the
things liable to trigger bitmap output (and will always do so for
<code>cairo_ps</code>).
</p>
<h3>Value</h3>
<p>A plot device is opened: nothing is returned to the <font face="Courier New,Courier" color="#666666"><b>R</b></font> interpreter.
</p>
<h3>Anti-aliasing</h3>
<p>Anti-aliasing is applied to both graphics and fonts. It is generally
preferable for lines and text, but can lead to undesirable effects for
fills, e.g. for <code>image</code> plots, and so is never used for
fills.
</p>
<p><code>antialias = "default"</code> is in principle platform-dependent, but
seems most often equivalent to <code>antialias = "gray"</code>.
</p>
<h3>Conventions</h3>
<p>This section describes the implementation of the conventions for
graphics devices set out in the “R Internals Manual”.
</p>
<ul>
<li><p> The default device size is in pixels (<code>svg</code>) or inches.
</p>
</li>
<li><p> Font sizes are in big points.
</p>
</li>
<li><p> The default font family is Helvetica.
</p>
</li>
<li><p> Line widths are multiples of 1/96 inch.
</p>
</li>
<li><p> Circle radii have a minimum of 1/72 inch.
</p>
</li>
<li><p> Colours are interpreted by the viewing application.
</p>
</li></ul>
<h3>See Also</h3>
<p><code>Devices</code>, <code>dev.print</code>, <code>pdf</code>,
<code>postscript</code>
</p>
<p><code>capabilities</code> to see if cairo is supported.
</p>
</body></html>