Quartz: Open quartz device

View source: R/Quartz.R

QuartzR Documentation

Open quartz device

Description

Wrapper to open a quartz device with default 4:3 dimensions for on-screen plotting or saving to a file, including the setting of default graphical parameters which are deliberately different from base R's setting to produce visually more appealing plots.

Usage

Quartz(
  file = NULL,
  type = "native",
  height = 6,
  width = 8,
  mar = c(5, 5, 0.5, 0.5),
  las = 1,
  cex.axis = 1.25,
  cex.lab = 1.5,
  cex.main = 1.5,
  ...,
  pointsize = 12,
  family = "Arial",
  antialias = TRUE,
  bg = "transparent",
  canvas = "white",
  dpi = NA_real_
)

Arguments

file

path to a file for storing a hardcopy of the plot including a supported file extension to set the type of output (e.g. ".pdf" or ".png"); i.e. the function extracts the extension from file and uses it as the type argument for the call to quartz. Defaults to NULL for on-screen plotting.

type

the type of output to use. Defaults to "native" for on-screen plotting. If file is not NULL, type is determined from the file name extension.

height

the height of the plotting area in inches. Default ‘6’.

width

the width of the plotting area in inches. Default ‘8’.

mar

a numerical vector of the form ‘c(bottom, left, top, right)’ which gives the number of lines of margin to be specified on the four sides of the plot. The default is c(5, 5, 0.5, 0.5).

las

the style of axis labels; default is to always use horizontal axis labels (note that you then need to manually set las = 0 for the y axis titles when using mtext).

cex.axis

the magnification to be used for axis annotation relative to the current setting of cex; defaults to 1.25.

cex.lab

the magnification to be used for x and y labels relative to the current setting of cex; defaults to 1.5.

cex.main

the magnification to be used for main titles relative to the current setting of cex; defaults to 1.5.

...

further graphical parameter settings passed on to Par.

pointsize

the default pointsize to be used. Default 12.

family

this is the family name of the font that will be used by the device. Default "Arial". This will be the base name of a font as shown in Font Book.

antialias

whether to use antialiasing. Default TRUE.

bg

the initial background colour to use for the device. Default "transparent". An opaque colour such as "white" will normally be required on off-screen types that support transparency such as "png" and "tiff".

canvas

canvas colour to use for an on-screen device. Default "white", and will be forced to be an opaque colour.

dpi

resolution of the output. The default (‘NA_real_’) for an on-screen display defaults to the resolution of the main screen, and to 72 dpi otherwise.

Value

invisibly, the original graphical parameter settings prior to the changes from a call to Quartz to enable restoring the default settings.

Author(s)

Thomas Münch

See Also

quartz; Par

Examples


# Create an empty on-screen quartz device
Quartz()

# Store empty plot in pdf format in local directory
## Not run: 
Quartz(file = file.path(getwd(), "test-quartz.pdf"))
dev.off()

## End(Not run)

EarthSystemDiagnostics/grfxtools documentation built on Aug. 5, 2023, 1:43 p.m.