Graphics Reference
In-Depth Information
NOTE
Although the argument name is dpi , it really controls the pixelsper inch (ppi), not the dotsper inch.
When a grey pixel is rendered in print, it is output with many smaller dots of black ink—and so print
output has more dots per inch than pixels per inch.
Discussion
R supports other bitmap formats, like BMP, TIFF, and JPEG, but there's really not much reason
to use them instead of PNG.
The exact appearance of the resulting bitmaps varies from platform to platform. Unlike R's PDF
output device, which renders consistently across platforms, the bitmap output devices may render
the same plot differently on Windows, Linux, and Mac OS X. There can even be variation within
each of these operating systems.
Different platforms will render fonts differently, some platforms will antialias (smooth) lines
while others will not, and some platforms support alpha (transparency) while others do not. If
your platform lacks support for features like antialiasing and alpha, you can use the CairoPNG()
device, from the Cairo package:
install.packages( "Cairo" ) # One-time installation
CairoPNG( "myplot.png" )
plot( ... )
dev.off()
While CairoPNG() does not guarantee identical rendering across platforms (fonts may not be
exactly the same), it does support features like antialiasing and alpha.
Changing the resolution affects the size (in pixels) of graphical objects like text, lines, and points.
For example, a 6-by-6-inch image at 75 ppi has the same pixel dimensions as a 3-by-3-inch image
at 150 ppi, but the appearance will be different, as shown in Figure 14-3 . Both of these images
are 450×450 pixels. When displayed on a computer screen, they may display at approximately
the same size, as they do here.
Search WWH ::




Custom Search