ploptions {plgraphics} | R Documentation |
The user can set (and get) options – mostly graphical "parameters" – which influence the behavior plgraphics functions.
ploptions(x = NULL, list = NULL, default = NULL, ploptions = NULL, assign = TRUE, setpar = FALSE, ...) .ploptions ploptionsDefault
x |
character (vector) of name(s) of ploptions to query.
If |
list |
a named list of options to be set, see Details |
default |
character vector of option names.
These ploptions will be set according to |
ploptions |
the list of options that should be modified |
assign |
logical: should the list be assigned to
|
setpar |
logical: should the 'margin parameters'
|
... |
any ploptions can be defined or modified,
using |
If the argument list
is set, it must be a named list,
and each component, with name name
and value value
is used as described for arguments in ...
, see above
(in addition to such arguments).
Here is a list of the components of ploptionsDefault
,
describing the suitable alternative values to be set by calling
ploptions
:
incomplete for the time being!!!
keeppar: logical. If TRUE, the graphical parameter settings "mar", "oma", "cex", "mgp", and "mfg" will be maintained when leaving high level pl functions, otherwise, the old values will be restored (default).
linewidth: vector of lwd
values to be used for
the different line types (lty
). The package
sets lwd
to a value
ploptions("linewidth")[lty]*lwd
intending to balance
the visual impact of the different line types, e.g.,
to allow a dotted line to make a similar impression as a solid
line.
ticklength: vector of 4 scalars: tickmark length,
corresponding to par("tcl")
. The first 2 elements
define the length of the regular tickmarks, the other two,
of the “small” tichmarks given by
attr(ticksat, "small")
(ticksat
is a possible
attribute of each variable).
There are two elements each in order to define tickmarks that
cross the axis.
tickintervals: vector of length 2. The first element is the
desired number of tick intervals for axes, to be used as argument
n
in pretty
.
The second determines how many tick labels are shown in the same
way, and should therefore be smaller than (or equal to) the first.
gridlines: can be
– a logical indicating if gridlines should be drawn. If
TRUE
, gridlines will be drawn at the values given in
attr(.,"ticksat")
;
– a vector of values at which the gridlines should appear;
– a list of length 2 of such values;
– a named list. If a name equals the attribute varname
of either the x or y variable, the respective component will be
used.
smooth.lty, smooth.col
: line type and color.
Note that if there is a smooth.group
factor,
group.lty
and group.col
are used.
smooth.lwd
: line width. If of length 2 (or more),
the second element is the factor by which the line width is
reduced for simulated smooths (that is, for the second to the last
column of smoothline$y
). It defaults to 0.7.
smooth.xtrim: proportion of fitted values to be trimmed off on
both sides when drawing a smooth line, either a number or a function
that takes the number of points as its argument.
The default is the simple function 2^log10(n)/n
.
The smoothing function may produce an attribute xtrim
that is used as an additional factor to smooth.xtrim
.
This is applied, e.g., to suppress trimming if a straight line is
fitted instead of a smooth by requiring smoothLm
as the
smoothing function.
smooth.minobs: minimal number of observations needed for calculating a smooth.
smooth.band: Indicator (logical) determining whether "low" and "high" smooth lines should be drawn. See above for their definition.
condquant...: Conditional quantiles for censored residuals.
condquant: logical: should bars be drawn for censored residuals?
If FALSE
, censored observations will be set to the median of
the conditional distribution and shown by a different plotting
character, see argument censored
of
ploptions
.
If NULL
, the standard plotting character will be used.
condquant.probrange: range for probabilities. If the probability corresponding to the censored part of the distribution is outside the range, bars will not be drawn.
condquant.pale: factor by which the pcol
color
will be paled to show the points (condquant.pale[1]
)
and the bars (...[2]
).
plcond...: features of plcond
.
plcond/panel: panel function to be used
plcond.nintervals: number of intervals into which numerical variables will be cut
plcond.extend: proportion of neighboring intervals for which points are shown. 0 means no overlap.
plcond.col: 4 colors to be used to mark the points of the neighboing intervals: The first and second ones color the points lower or higher than the interval of the horizontal conditioning variable, and the other two regulating the same features for the vertical variable. The points which are outside the intervals of both conditioning variables will get a mixed color.
plond.pale: minimum and maximum paling, to be applied for distance 0 and maximal distance from the interval.
plcond.cex: proportion of cex
used to show
the points outside the interval
For ploptions(x)
, where x
is the name of a pl option,
the current value of the option.
or NULL
if it is not such a name.
If x
contains several (valid) names, the respective list.
For ploptions()
, the list of all plptions sorted by name.
For uses setting one or more options, the important effect is a changed
list .ploptions
that is used by the packages functions
(if assign
is TRUE
).
The (invisibly) returned value is the same list, complemented by an
attribute "old"
containing the previous values of those options
that have been changed.
This list is useful for undoing the changes, usually at the end of
graphical functions, to restore the previous status.
.ploptions
and ploptionsDefault
are lists of options.
The first one is generated whenever ploptions are set
(and assign
is TRUE
), and is then
stored in the ".GlobalEnv"
environment.
The second is stored in the package plgraphics
.
In contrast to the options
of R base,
the .plptions
list is stored in the .GlobalEnv
(if any component is changed)
and will be recovered if the latter is stored and loaded again.
Werner A. Stahel
stamp
; R's own predefined options()
.
## see example(stamp) ploptions("stamp") ploptions(c("jitterFactor", "gridlines")) ## set options ploptions(stamp=FALSE, pch=0, col=c.colors[-1], anything="do what you want") ploptions(c("stamp", "anything")) ploptions(default=TRUE) t.plopt <- ploptions(smooth.col="green", assign=FALSE) t.plopt$smooth.col ploptions("smooth.col") ## unchanged ## setting 'margin parameters' mar, oma, mgp, cex : ploptions(mar=c(2,2,1,1)) ## only active in pl funcions ## (unless ploptions("keeppar") is FALSE ) ploptions(mar=c(2,2,1,1), setpar=TRUE) ## changes the margins permanently ploptions(setpar=TRUE) ## does the same. All the margin pars are ## set permanently to the values in .ploptions ## switching 'margin parameters' between those used ## outside and inside high level pl functions par(mar=c(2,2,5,2)) plyx(Sepal.Width~Sepal.Length, data=iris) par("mar") mtext("wrong place for text",3,1, col="red") t.plo <- plmarginpar() par("mar") mtext("here is the right place",3,1) par(attr(t.plo, "oldpar")) ## resets the 'margin parameters' par("mar") plyx(Sepal.Width~Sepal.Length, data=iris, keeppar=TRUE) par("mar")