quartz starts a graphics device driver for the macOS system.
It supports plotting both to the screen (the default) and to various
graphics file formats.
quartz(title, width, height, pointsize, family, antialias, type, file = NULL, bg, canvas, dpi) quartz.options(..., reset = FALSE) quartz.save(file, type = "png", device = dev.cur(), dpi = 100, ...)
title for the Quartz window (applies to on-screen output
the width of the plotting area in inches. Default
the height of the plotting area in inches. Default
the default pointsize to be used. Default
this is the family name of the font
that will be used by the device. Default
whether to use antialiasing. Default
the type of output to use. See ‘Details’ for
more information. Default
an optional target for the graphics device. The default,
the initial background colour to use for the device. Default
canvas colour to use for an on-screen device. Default
resolution of the output. The default (
Any of the arguments to
logical: should the defaults be reset to their defaults?
device number to copy from.
The defaults for all but one of the arguments of
quartz are set
quartz.options: the ‘Arguments’ section gives the
The Quartz graphics device supports a variety of output types.
On-screen output types are
"Cocoa". Off-screen output types produce output files and
type = "pdf" gives PDF
output. The following bitmap formats may be supported (depending on
the OS version):
"psd" (Adobe Photoshop),
"bmp" (Windows bitmap),
file argument is used for off-screen drawing. The actual
file is only created when the device is closed (e.g., using
dev.off()). For the bitmap devices, the page number is
substituted if a C integer format is included in the character string,
Rplot%03d.png. (The result must be less than
PATH_MAX characters long, and may be truncated if not. See
postscript for further details.) If a
argument is not supplied, the default is
Rplot%03d.type. Tilde expansion
path.expand) is done.
If a device-independent R graphics font family is specified (e.g.,
par(family =) in the graphics package), the Quartz device
makes use of the Quartz font database (see
convert the R graphics font family to a Quartz-specific font family
description. The default conversions are (MonoType TrueType versions
On-screen devices are launched with a semi-transparent canvas. Once a
new plot is created, the canvas is first painted with the
canvas colour and then the current background colour (which can
be transparent or semi-transparent). Off-screen devices have no
canvas colour, and so start with a transparent background where
type = "png" and
type = "tiff") –
otherwise it appears that a solid white canvas is assumed in the
Quartz code. PNG and TIFF files are saved with a dark grey matte
which will show up in some viewers, including
title can be used for on-screen output. It must be a single
character string with an optional integer printf-style format that
will be substituted by the device number. It is also optionally used
(without a format) to give a title to a PDF file.
for on-screen devices and to
The font family chosen needs to cover the characters to be used:
characters not in the font are rendered as empty oblongs. For
non-Western-European languages something other than the default of
"Arial" is likely to be needed—one choice for Chinese is
quartz.save is a modified version of
to copy the plot from the current screen device to a
device, by default to a PNG file.
This section describes the implementation of the conventions for graphics devices set out in the ‘R Internals’ manual.
The default device size is 7 inches square.
Font sizes are in big points.
The default font family is Arial.
Line widths are a multiple of 1/96 inch with no minimum set by R.
Circle radii are real-valued with no minimum set by R.
Colours are specified as sRGB.
For a long time the default font family was documented as
"Helvetica" after it had been changed to
"Arial" to work
around a deficiency in macOS 10.4. It may be changed back in future.
A fairly common Mac problem is no text appearing on plots due to
corrupted or duplicated fonts on your system. You may be able to
confirm this by using another font family,
family = "serif".
Font Book application (in
check the fonts that you are using.
png for way to access the bitmap types of this device
via R's standard bitmap devices.
## Not run: ## Only on a Mac, ## put something like this is your .Rprofile to customize the defaults setHook(packageEvent("grDevices", "onLoad"), function(...) grDevices::quartz.options(width = 8, height = 6, pointsize = 10)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.