Description Usage Arguments See Also Examples
Draw wedge-shaped line segments between pairs of points.
1 2 3 4 5 6 7 8 9 10 |
x0 |
Numeric vector of x coordinates from which to draw the wide base of the wedges. |
y0 |
Numeric vector of y coordinates from which to draw
the wide base of the wedges. Must be the same length as |
x1 |
Numeric vector of x coordinates to which to draw
the narrow point of the wedges. Must be the same length as |
y1 |
Numeric vector of y coordinates to which to draw
the narrow point of the wedges. Must be the same length as |
ybase |
Numeric vector giving the width of the wedge bases in y-scale units,
default 3
length as |
pborder |
Vector of colors to draw the borders of the wedges.
The default, NA, omits borders.
Must be of length 1 or the same length as |
pcol |
Vector of colors to fill the wedges, default "darkgray".
Must be of length 1 or the same length as |
... |
Additional arguments to |
1 2 3 4 5 6 7 8 9 10 11 12 | df <- data.frame(x=runif(5, 0, 1), y=runif(5, 0, 10))
# draw a single wedge
plot(df)
with(df, wedges(x[1], y[1], x[2], y[2], ybase=1))
# draw several wedges from point to point
s <- seq(length(df$x)-1)
plot(df)
with(df, invisible(lapply(s, function(i)
wedges(x[i], y[i], x[i+1], y[i+1], pborder=(5:2)[i], pcol=(2:5)[i])
)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.