SetPlotPar: Default plotting parameters

Description Usage Arguments Value Author(s) See Also Examples

View source: R/paper-plotting-functions.R

Description

This function returns a list of default plotting parameters specified as its function arguments, which can then be set via a call to par. Additional parameters can be specified via .... This wrapper function provides a convenient way to set new graphics parameters and save their old values for later restoring at the same time; see the example.

Usage

1
2
3
4
5
6
7
8
SetPlotPar(
  mar = c(5, 5, 0.5, 0.5),
  las = 1,
  cex.main = 1.5,
  cex.lab = 1.5,
  cex.axis = 1.25,
  ...
)

Arguments

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.main

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

cex.lab

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

cex.axis

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

...

further graphical parameter settings passed on to par.

Value

A list of plotting parameters to be used with par().

Author(s)

Thomas Münch

See Also

par

Examples

1
2
3
4
5
6
7
8
9
# Default settings
op <- par(proxysnr:::SetPlotPar())
plot(1 : 10, xlab = "X title", ylab = "Y title", type = "l")
par(op)

# Change default line width and increase outer margin
op <- par(proxysnr:::SetPlotPar(lwd = 2, oma = c(2, 2, 2, 2)))
plot(1 : 10, xlab = "X title", ylab = "Y title", type = "l")
par(op)

EarthSystemDiagnostics/proxysnr documentation built on Oct. 2, 2021, 3:03 p.m.