Set or Query Graphics Parameters (zipfR)

Description

Set default graphics parameters for zipfR high-level plots and plot utilities, similar to par for general graphics parameters. The current parameter values are queried by giving their names as character strings. The values can be set by specifying them as arguments in name=value form, or by passing a single list of named values.

NB: This is an advanced function to fine-tune zipfR plots. For basic plotting options (that are likely to be sufficient for most purposes) see plot.spc and plot.vgc instead.

Usage

1
  zipfR.par(..., bw.mode=FALSE)

Arguments

...

either character strings (or vectors) specifying the names of parameters to be queried, or parameters to be set in name=value form, or a single list of named values. A listing of valid parameter names is given below.

bw.mode

if TRUE and parameter values are queried, then return the corresponding parameters for B/W mode if possible (e.g., zipfR.par("col",bw.mode=TRUE) returns the value of the col.bw parameter). Note that bw.mode cannot be abbreviated in the function call!

Details

Parameters are set by specifying their names and the new values as name=value pairs. Such a list can also be passed as a single argument to zipfR.par, which is typically used to restore previous parameter values (that have been saved in a list variable).

Most of the default values can be manually overridden in the high-level plots.

zipfR.par() shows all parameters with their current values, and names(zipfR.par()) produces a listing of valid parameter names.

Value

When parameters are set, their former values are returned in an invisible named list. Such a list can be passed as a single argument to zipfR.par to restore the parameter values.

When a single parameter is queried, its value is returned directly. When two or more parameters are queried, the result is a named list.

Note the inconsistency, which is the same as for par: setting one parameter returns a list, but querying one parameter returns a vector (or a scalar, i.e. a vector of length 1).

zipfR Graphics Parameters

col

a character or integer vector specifying up to 10 line colours (see the par manpage for details). Values of shorter vectors are recycled as necessary.

lty

a character or integer vector specifying up to 10 line styles (see the par manpage for details). Values of shorter vectors are recycled as necessary.

lwd

a numeric vector specifying up to 10 line widths (see the par manpage for details). Values of shorter vectors are recycled as necessary.

pch

a character or integer vector specifying up to 10 plot symbols. Values of shorter vectors are recycled as necessary.

barcol

a character or integer vector specifying up to 10 colours for the bars in non-logarithmic spectrum plots. Values of shorter vectors are recycled as necessary.

col.bw

the line colours used in B/W mode (bw=TRUE)

lty.bw

the line styles used in B/W mode (bw=TRUE)

lwd.bw

the line widths used in B/W mode (bw=TRUE)

pch.bw

the plot symbols used in B/W mode (bw=TRUE)

barcol.bw

the bar colours used in B/W mode (bw=TRUE)

bw

if TRUE, plots are drawn in B/W mode unless specified otherwise (default: FALSE, i.e. colour mode

device

plot device used by the zipfR plotutils (see zipfR.begin.plot for details). Currently supported devices are x11 (default on most platforms), eps, pdf, as well as png and quartz where available (default on Mac OS X).

init.par

list of named graphics parameters passed to the par function whenever a new viewport is created with zipfR.begin.plot

width, height

default width and height of the plotting window opened by zipfR.begin.plot

See Also

plot.spc, plot.vgc, zipfR.begin.plot, zipfR.end.plot

Examples

1
2
3
4
5
6
7
8
9
print(names(zipfR.par()))         # list available parameters

zipfR.par("col", "lty", "lwd")    # the default line styles
zipfR.par(c("col", "lty", "lwd")) # works as well

## temporary changes to graphics paramters:
par.save <- zipfR.par(bw=TRUE, lwd.bw=2)
## plots use the modified parameters here
zipfR.par(par.save)		  # restore previous values

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.