sl.plot.colbar | R Documentation |
Plot a spheRlab colourbar, vertically or horizontally, with a number of options.
sl.plot.colbar(colbar, categorical = FALSE, breaks = NULL, vertical = TRUE, labels.at = NULL, labels.num = min(length(breaks),5), labels = NULL, labels.side = "bottom", labels.cex = 1, labels.signif = 3, ticks.length = 1, ticks.mirrored = FALSE, ratio = 0.1, triag.ends = FALSE, device = "pdf", do.init = TRUE, do.init.device = TRUE, do.close.device = do.init.device, file.name = paste0("~/sl.plot.colbar.",device), width = 6, xshift = 0, yshift = 0, len = 0.6, units = NULL, units.xy = NULL, labels.col = "black")
colbar |
a spheRlab colourbar of length |
categorical |
a logical value specifying whether the colourbar is categorical. If |
breaks |
a vector of length |
vertical |
a logical value specifying whether the colourbar is to be plotted vertically (default). If |
labels.at |
|
labels.num |
a scalar specifiying how many labels are to be drawn in a quasi equidistant manner. Used only if |
labels |
|
labels.side |
NOT YET USED! - a character specifying the side of the colourbar at which the labels are to be placed. |
labels.cex |
a scalar specifying the relative size of the labels. |
labels.signif |
an integer specifying the number of significant digits to be printed for the labels. Used only if |
ticks.length |
NOT YET USED! |
ticks.mirrored |
NOT YET USED! |
ratio |
a scalar specifying the ratio of width and length of the colourbar. By default |
triag.ends |
a logical value indicating whether the ends of the colourbar (that is, the last colour polygons) shall be triangular. By default |
device |
a character specifying which graphics device to use. Default is |
do.init |
a logical value indicating whether or not an initial call of |
do.init.device |
a logical value indicating whether or not to initialise a device as specified by |
do.close.device |
a logical value specifying whether to call |
file.name |
a character specifying the output file name of the figure. By default |
width |
a scalar specifying the width of the figure. |
xshift |
a scalar specifying how far the colourbar shall be shifted from the plot coordinate origin in x-direction. Default is |
yshift |
a scalar specifying how far the colourbar shall be shifted from the plot coordinate origin in y-direction. Default is |
len |
a scalar specifying the (absolute) length of the colourbar. Default is |
units |
a character specifying a units string to be added to the plot. Default is |
units.xy |
a two-element numeric vector specifying the relative (scaled by |
labels.col |
the colour of the labels (and units). |
By default, colourbars in spheRlab follow the philosophy that they are plotted separately of the fields they annotate. In this case, combining a plotted field and its colourbar subsequently is left to the user and his or her choice of external software (e.g., OpenOffice or the like). This increases the simplicity and flexibility of plot handling within spheRlab.
It is also possible to add a colourbar to an existing plot by setting do.init=FALSE
and adjusting xshift
, yshift
, and len
. If adding to a spheRlab plot initialised with sl.plot.init
or variants thereof, note that the plot x-y-ranges are stored in the list returned by the initialising function call in the elements xlim
and ylim
.
An integer giving the device into which the figure was plotted.
This function still has some unused arguments that should be implemented at some point.
Helge Goessling
sl.colbar
, sl.num2colbar
, sl.view.colbar
cb = sl.colbar(cols=rgb(c(1,0,0),c(.5,.5,.5),c(0,0,1)),N=10)
breaks = seq(.1,.9,.1)
sl.plot.colbar(colbar=cb,breaks=breaks,do.init.device=F,units="(K)")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.