Draw colored box indicating the active R plot space
Usage
usrBox(
fill = "#FFFF9966",
label = NULL,
parUsr = graphics::par("usr"),
debug = FALSE,
...
)Arguments
- fill
characterR color used to fill the background of the plot- label
charactertext optionally used to label the center of the plot space, defaultNULL- parUsr
numericvector length 4, indicating the R plot space, consistent withgraphics::par("usr"). It can thus be used to define a different area, though using therectfunction directly seems more appropriate.- debug
logicalwhether to print the parUsr value being used.- ...
additional arguments are ignored.
Value
no output, this function is called for the byproduct of adding a box in the usr plot space of an R graphics device.
Details
This function simply draws a box indicating the active plot space, and by default it shades the box light yellow with transparency. It can be useful to indicate the active plot area while allowing pre-drawn plot elements to be shown, or can be useful precursor to provide a colored background for the plot.
The plot space is defined using graphics::par("usr") and therefore requires
an active R device is already opened.
See also
Other jam plot functions:
adjustAxisLabelMargins(),
coordPresets(),
decideMfrow(),
drawLabels(),
getPlotAspect(),
groupedAxis(),
imageByColors(),
imageDefault(),
minorLogTicksAxis(),
nullPlot(),
plotPolygonDensity(),
plotRidges(),
plotSmoothScatter(),
shadowText(),
shadowText_options(),
showColors(),
sqrtAxis()
Examples
# usrBox() requires that a plot device is already open
nullPlot(doBoxes=FALSE);
usrBox();