Description Usage Arguments See Also Examples
Plot a data data frame with one independent and several dependend variables as stacked polygons.
1 |
x |
object of class |
columns |
vector of column names in appropriate order which are plotted |
density |
vector with densities of shading lines, in lines per inch. The
default value of |
angle |
vector with slopes of shading lines, given as an angle in degrees (counter-clockwise). |
border |
the color to draw the border. The default, |
col |
the color for filling the polygon. The default,
|
xlab |
a title for the x axis: see |
ylab |
a title for the y axis: see |
... |
other graphical parameters passed to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## test data
dat <- data.frame(time = seq(7, 365, 14),
y1 = runif(26, min=1, max=10),
y2 = runif(26, min=0, max=15),
y3 = runif(26, min=0, max=2)
)
## example palette
palette <-c("grey", "brown", "green", "yellow", "yellowgreen",
"darkgreen", "blue", "black", "red", "grey", "red", "orange",
"pink", "cyan"
)
## usage
stackedpoly(dat, c("y1", "y2", "y3"), col=palette)
## polygons with border
stackedpoly(dat, c("y1", "y2", "y3"), col=palette, border="black")
## optional plotting parameters
stackedpoly(dat, c("y1", "y2", "y3"), col=palette, ylim=c(0,50), main="Phytoplankton")
## changed order
stackedpoly(dat, c("y3", "y2", "y1"), col=palette, main="Phytoplankton")
## hatched area
stackedpoly(dat, c("y3", "y2", "y1"), density=c(20, 20, 40),
angle=c(0, 90, 45), ylim=c(0,50), border=palette, main="Phytoplankton")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.