panel.segplot: Default prepanel and panel functions for segplot

View source: R/segplot.R

panel.segplotR Documentation

Default prepanel and panel functions for segplot

Description

Draws line segments or rectangles. Mainly intended to be used in conjunction with the segplot function.

Usage

prepanel.segplot(x, y, z, subscripts, horizontal = TRUE, ...)

panel.segplot(x, y, z, level = NULL, subscripts, 
              at,
              draw.bands = is.factor(z),
              col, alpha, 
              lty, lwd,
              border,
              col.symbol = col, alpha.symbol = alpha,
              col.regions = regions$col,
              band.height = 0.6,
              horizontal = TRUE, 
              ...,
              segments.fun = panel.segments,
              centers = NULL,
              pch = 16)

Arguments

x, y, z

Vectors corresponding to x1, x2 and y respectively in the segplot formula. The names are different for compatibility with panel.levelplot. These are all the original vectors in data, not subsetted for particular panels.

level

optional vector controlling color of segments

centers

optional vector of ‘centers’ of the segments. If specified, points will be plotted at these y-locations.

pch

plotting character used for centers.

subscripts

integer subscript to be used as an indexing vector for x, y, z and level, giving the packet for the current panel.

horizontal

logical, whether the segments are to be drawn horizontally (the default) or vertically. This essentially swaps the role of the x- and y-axes in each panel.

at

values of level where color code changes

draw.bands

logical, whether to draw rectangles instead of lines

col, alpha, lty, lwd, border

Graphical parameters for the segment. Defaults to parameter settings for "plot.line" or "plot.polygon" for segments and rectangles respectively. col is overridden by col.regions if level is not null.

col.symbol, alpha.symbol

Graphical parameters for the point if centers are plotted. Defaults to the corresponding parameters for the segment.

col.regions

vector of colors as in levelplot

band.height

height of rectangles (applicable if draw.bands is TRUE

...

Other arguments, passed on to panel.rect (when draw.bands=TRUE), segments.fun (otherwise), panel.points (if centers is not NULL), etc. as appropriate.

segments.fun

function used to plot segments when draw.bands is FALSE. The default is to use panel.segments, but panel.arrows is a useful alternative (arguments to segments.fun can be provided via the ... argument, see example for segplot).

Value

For prepanel.segplot a list with components xlim and ylim.

Author(s)

Deepayan Sarkar deepayan.sarkar@r-project.org

See Also

segplot


latticeExtra documentation built on July 4, 2022, 5:05 p.m.