Internal / Helper functions of package RobAStBase for plot functions
These functions are internally used helper functions for plot
,
infoPlot
comparePlot
in package RobAStBase.
.rescalefct(x, fct, scaleX = FALSE, scaleX.fct, scaleX.inv, scaleY = FALSE, scaleY.fct = pnorm, xlim, ylim, dots) .plotRescaledAxis(scaleX, scaleX.fct, scaleX.inv, scaleY,scaleY.fct, scaleY.inv, xlim, ylim, X, ypts = 400, n = 11, finiteEndpoints = rep(FALSE,4), x.ticks = NULL, y.ticks = NULL, withbox = TRUE) .legendCoord(x, scaleX, scaleX.fct, scaleY, scaleY.fct) .SelectOrderData(data, fct, which.lbs, which.Order, which.nonlbs = NULL) .makedotsP(dots) .makedotsLowLevel(dots) .cexscale(y, y1=y, maxcex=4,mincex=0.05,cex, fun=NULL) .getX.vec(distr, dims0, lty, x.vec, scaleX, scaleX.fct, scaleX.inv, xm, xM) .getXlimYlim(dots,dotsP, dims0, xlim, ylim) .prepareTitles(withSubst, presubArg2, presubArg3, dots, mainText, L2Fam, inner, dims0, dims, to.draw, trafO, obj, type, bmar, tmar) .getToDraw(dims, trafO, L2Fam, to.draw.arg, Abs=NULL) .preparePanelFirstLast(with.automatic.grid , dims0, pF.0, pL.0, logArg, scaleX, scaleY, x.ticks, y.ticks, scaleX.fct, scaleY.fct)
scaleX |
logical; shall X-axis be rescaled (by default according to the cdf of the underlying distribution)? |
scaleY |
logical; shall Y-axis be rescaled (by default according to a probit scale)? |
scaleX.fct |
an isotone, vectorized function mapping the domain of the IC
to [0,1]; if |
scaleX.inv |
the inverse function to |
scaleY.fct |
an isotone, vectorized function mapping for each coordinate the range of the respective coordinate of the IC to [0,1]; defaulting to the cdf of N(0,1). |
scaleY.inv |
an isotone, vectorized function mapping for each coordinate the range [0,1] into the range of the respective coordinate of the IC; defaulting to the quantile function of N(0,1). |
fct |
for |
xlim |
numeric vector of length 2: limits of the plotted x region (in original scale). |
ylim |
numeric vector of length 2: limits of the plotted y region (in original scale). |
finiteEndpoints |
a logical of length 4: are the unscaled |
x.ticks |
numeric: coordinates in original scale of user-given ticks on x-axis. |
y.ticks |
numeric: coordinates in original scale of user-given ticks on y-axis. |
n |
integer: number of default ticks in x and y axis. |
X |
numeric: x-values on [0,1]-scale from which to produce range of x axis. |
ypts |
integer: number of y-points to be generated on [0,1] range to produce y-axis. |
dots |
dots argument for later calls to |
x |
coordinates of the legend placement to be rescaled when using a scale transformation. |
data |
numeric or data.frame containing numerics; observations to be plotted into a graph. |
which.lbs |
either an integer vector with the indices of the observations
to be plotted into graph or |
which.Order |
indices of the observations after ordering which are to be
plotted into the graph; more speficically, the indices are obtained after
a possible thin-out by |
which.nonlbs |
indices of the observations which should be plotted but
not labelled; either an integer vector with the indices of the observations
to be plotted into graph or |
withbox |
logical of length 1. If |
dots |
a list; intended to be the |
y |
input at which to compute |
y1 |
secondary input of |
maxcex |
maximal value for |
mincex |
minimal value for |
cex |
basic factor for |
fun |
(optional) function to compute the |
L2Fam |
L2-Family |
,
to.draw.arg |
resp. argument from the user-interface of |
panelFirst |
the |
distr |
underlying distribution of the observations |
dims0 |
number of panels to be plotted |
lty |
the |
x.vec |
the resp. argument from the user interface. |
xm |
minimal x-value |
xM |
maximal x-value |
dots |
the internal |
dotsP |
the internal |
xlim |
the possibly matrix-valued argument of the user interface |
ylim |
the possibly matrix-valued argument of the user interface |
withSubst |
should substitutions be made in titles? |
presubArg2 |
title part |
presubArg3 |
title part |
mainText |
text to be used for |
inner |
the resp. argument from the user interface. |
dims |
the dimension of the pIC |
to.draw |
the actual numbers / names of the plotted panels. |
trafO |
the parameter transformation of |
obj |
the object from which to draw the name (of the plot). |
type |
for which type of plot should the titles be produced – |
bmar |
resp. argument from the user-interface of |
tmar |
resp. argument from the user-interface of |
Abs |
additional text template used in |
with.automatic.grid |
|
pF.0 |
the |
pL.0 |
the |
logArg |
a character vector with |
.rescalefct
rescales, if necessary, x and y axis for use in plot
functions. More specifically, if scaleX
is TRUE
rescales x,
if scaleY
is TRUE
rescales fct(x) (otherwise leaves them
unchanges); to this end uses trafos scaleX.fct
with inverse
scaleX.inv
, resp. scaleY.fct
; it respects xlim
and ylim
(given in orig. scale), thins out the scaled values if
necessary and accordingly modifies slots xaxt
, yaxt
, and
axes
of argument dots
to indicate the new axes have to be drawn;
using the paradigm small letters to denote values on original scale and
capital letters on transformed scale, its return value is a list with
(thinned out) values of x and y, X and Y and modified dots.
.plotRescaledAxis
plots rescaled axes according to logicals
scaleX
, scaleY
; to this end uses trafos scaleX.fct
with
inverse scale.inv
, resp. scaleY.fct
, scaleY.inv
;
it respects xlim
and ylim
. By default, ot produces the x axes according
to the values in argument X
, and the y axes as an equidistant grid of
length ypts
on [0,1] (on transformed scale); each of these axes, again
by default will have n
tick values; these are however thinned out if
the come to lie too close to each other on transformed scale.
Instead of producing automatically chosen tick values, the user may explicitly
require x-ticks and y-ticks values on the axes, using arguments x.ticks
and y-ticks
. This function has no return value.
.legendCoord
produces, if needed (i.e., if coordinates are not
given as strings like "bottomright"
), rescaled coordinates for the
placement of a legend.
.SelectOrderData
, for data to be plotted into the graph,
performs two optional selections: a first selection on the unordered (original)
data (acc. to argument which.lbs
) and a second selection according to
which.Order
on the data remaining after the first selection and ordered
according to argument fct
; the return value is a list with elements
data
, ie., the selected/thinned out data, y
, ie., the
values of fct(data)
, ind
, ie., the indices of the selected data
in the original data (after possibly two selections), and ind1
the
indices of the data selected by which.lbs
in the original data; in
addition also the non selected data, data.ns
, the respective
y-values y.ns
and the corresponding index elements ind.ns
are
returned as list items.
.makedotsP
and .makedotsLowLevel
manipulate the ...
argument, deleting certain items and selecting items which can be digested by
plot
, returning the manipulated list.
.cexscale
rescales the point sizes of the points to be plotted;
the unscaled sizes are given in argument y
, y1
in
case of several lines of points to be plotted may contain the
vector of the sizes of all points to be plotted in (e.g., including
those of the other lines of points). maxcex
and mincex
are maximum and minimum of the raw rescaled sizes; cex
is
a factor drawn from argument cex.pts
by which the raw sizes
are rescaled before being returned. fun
is the function
by which the rescaling is done; by default this argument is NULL
and in this case the function log(1+abs(x))
is used.
.getDimsTD
returns the number of different coordinates to be plotted.
.producePanelFirstS
for each graphical panel inserts
(if needed) x and y tickmarks for user-specific axes
into a panel.first
expression.
.getX.vec
produces the x-grid (on original scale) for each of the panels
and decides whether to plot lines or points.
.getXlimYlim
produces panel-wise xlim
and ylim
arguments
as well as left and right endpoints of the x-scalas.
.prepareTitles
produces the titles for the panels
.getToDraw
computes which panels are to be drawn
.preparePanelFirstLast
prepares the panel.first
and panel.last
expressions for each of the panels.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.