sl.plot.colbar: Plot Colourbar

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/sl.plot.colbar.R

Description

Plot a spheRlab colourbar, vertically or horizontally, with a number of options.

Usage

1
sl.plot.colbar(colbar, breaks, vertical = TRUE, labels.at = NULL, labels.num = min(length(breaks),9), labels = as.character(signif(breaks, 3)), labels.side = "bottom", labels.cex = 1, ticks.length = 1, ticks.mirrored = FALSE, ratio = 0.1, triag.ends = FALSE, device = "pdf", do.init.device = TRUE, do.close.device = do.init.device, file.name = paste0("~/sl.plot.colbar.",device), width = 6)

Arguments

colbar

A spheRlab colourbar of length N (as returned by sl.colbar).

breaks

a vector of length N-1 specifying the breaks corresponding to colbar.

vertical

a logical value specifying whether the colourbar is to be plotted vertically (default). If vertical=FALSE, a horizontal colourbar is plotted.

labels.at

NULL or a vector of length N-1 with logical values specifying which breaks are to be labelled. If NULL (default), the argument labels.num is used to place labels automatically in a quasi equidistant manner.

labels.num

a scalar specifiying how many labels are to be drawn in a quasi equidistant manner. Used only if labels.at=NULL. Default is labels.num=min(length(breaks),9).

labels

a vector of length N-1 with characters specifying the break labels. By default, labels are derived from breaks. Note that this vector has the same length as breaks, meaning that it must include pseudo entries even for breaks that are not labelled.

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.

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 ratio=0.1.

triag.ends

a logical value indicating whether the ends of the colourbar shall be triangular. By default triag.ends=FALSE. TRIANGULAR ENDS ARE NOT YET IMPLEMENTED!

device

a character specifying which graphics device to use. Default is device='pdf'. Ignored if do.init.device=FALSE.

do.init.device

a logical value indicating whether or not initialise a device as specified by device. Default is do.init.device=do.init. If do.init.device=FALSE but do.init=TRUE, the plot will be initialised in the standard graphical device.

do.close.device

a logical value specifying whether to call dev.off() to close the corresponding device in the end. Default is do.close.device=do.init.device.

file.name

a character specifying the output file name of the figure. By default file.name=paste0("~/sl.plot.colbar.",device).

width

a scalar specifying the width of the figure.

Details

Colourbars in spheRlab follow the philosophy that they are plotted separately of the fields they annotate. 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 substantially increases the simplicity and flexibility of plot handling within spheRlab.

Value

An integer giving the device into which the figure was plotted.

Note

NOTE THAT SO FAR THIS FUNCTION HAS UNUSED ARGUMENTS AND OTHER GAPS THAT NEED TO BE FILLED ASAP!

Author(s)

Helge Goessling

See Also

sl.colbar, sl.num2colbar, sl.view.colbar

Examples

1
2
3
4
cb = sl.colbar(cols=list(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)
## Should result in a corresponding figure stored in the file '~/sl.plot.colbar.pdf'

helgegoessling/spheRlab documentation built on Sept. 29, 2018, 12:09 p.m.