add.segments: Function to add horizontal line segments to an existing plot
Description
Adds horizontal line segments to an existing plot. The segments are
centered at x with height y. The x values are
assumed to be equally spaced, so that diff(x) is a constant
'dx'. The line segments go from x +/- half.width.factor
*dx, so if half.width.factor=.5 there will be no gaps between
segments. The default is to leave a small gap.
This function was originally used to add reference lines to
side-by-side boxplots.
Usage
AddSegments(x, y, half.width.factor = 0.45, ...)
Value
Called for its side effect.
Arguments
x
A numeric vector giving the midpoints of the line segments.
y
A numeric vector of the same length as x giving the vertical
position of the line segments
half.width.factor
See 'description' above.
...
graphical parameters controlling the type of lines used in the line segments