ploptions | R Documentation |
The user can set (and get) 'pl' options – mostly graphical "parameters" – which influence the behavior plgraphics functions.
ploptions(x = NULL, ploptions = NULL, list = NULL, default = NULL,
assign = TRUE, ...)
default.ploptions
x |
character (vector) of name(s) of ploptions to query.
If |
ploptions |
the list of options that should be inspected or
modified. Defaults to |
list |
a named list of options to be set, see Details |
default |
character vector of option names.
These ploptions will be set according to |
assign |
logical: should the list be assigned to
|
... |
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).
There is an object ploptions
in the pl.envir
environment, which contains the ploptions that have been used
(usually after modification) by the high level pl function
last called. This list is used by subsequent calls of lower level pl
functions. Advanced uses may want to modify this list by assigning to
pl.envir$ploptions$pch
, for example.
Here is an incomplete list of the components of default.ploptions
,
describing the suitable alternative values to be set by calling
ploptions
. For the full set, see
?ploptions.list
.
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).
The palette to be used by pl functions
General character size, relative to par("cex")
default argument for colorpale
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.
plotting symbols or characters
size of plotting symbols, relative to default. This may be a function with an argument that will be the number of observations at the time it is used.
size of point labels, relative to csize.pch
maximum value of size of plotting symbols
line type(s) and width(s)
colors to be used generally and
specifically for points (symbols or text) and lines, respectively,
given as index of ploptions("colors")
.
This are often (and by default) vectors to be used for showing
groups. The first element is usually black.
the palette to be used
...
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.
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.
minimal number of observations needed for calculating a smooth.
Indicator (logical) determining whether "low" and "high" smooth lines should be drawn. See above for their definition.
Conditional quantiles for censored residuals.
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.
range for probabilities. If the probability corresponding to the censored part of the distribution is outside the range, bars will not be drawn.
factor by which the pcol
color
will be paled to show the points (condquant.pale[1]
)
and the bars (...[2]
).
features of plcond
.
panel function to be used
number of intervals into which numerical variables will be cut
proportion of neighboring intervals for which points are shown. 0 means no overlap.
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.
minimum and maximum paling, to be applied for distance 0 and maximal distance from the interval.
symbol size, relative to 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 usr.ploptions
in the pl.envir
environment
that is used by the package's 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 to restore
the previous status.
Werner A. Stahel
stamp
; ploptions.list
;
pl.envir
;
R's own predefined options()
.
## get options
ploptions(c("jitter.factor", "gridlines"))
ploptions("stamp") ## see example(stamp)
ploptions() ## all pl options, see '?ploptions.list'
## set options
ploptions(stamp=FALSE, pch=0, col=c.colors[-1], anything="do what you want")
ploptions(c("stamp", "anything"))
ploptions(default=TRUE) ## reset all pl options, see '?ploptions.list'
## assign to transient options
t.plopt <- ploptions(smooth.col="purple", assign=2)
t.plopt$smooth.col
attr(t.plopt, "old")
ploptions("smooth.col") ## unchanged
ploptions("smooth.col", ploptions=2) ## transient options
pl.envir$ploptions["smooth.col"] ## the same
## 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, title="The famous iris data set")
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")
## manipulating 'pl.envir$ploptions'
plyx(Sepal.Width~Sepal.Length, data=iris)
pl.envir$ploptions$pch
plpoints(7,4, csize=4)
pl.envir$ploptions$pch <- 4
plpoints(7.5,4, csize=4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.