View source: R/panel-ebars-function.R
panel.ebars.grouped | R Documentation |
This function has been designed for plotting of errorbars in lattice plots. This is an alternative to the more complex panel-function called panel.binned.errorbars. Example:
N <- 50
df <- data.frame(degC = sample(20:25,N,replace=TRUE),counts=NA,instrument=sample(c("Fluke","HP"),N,replace=TRUE))
df$counts <- df$degC * 1.1 + rnorm(nrow(df),mean=0,sd=0.3)
xyplot(counts ~ degC|instrument, data=df, panel=function(x,y,...){ panel.xyplot(x,y,...); panel.ebars.grouped(x,y,type="sd",err.type="b",err.col="red",err.pch=16,err.cex=0.8,err.lwd=1,err.width=1.2,err.offset=0) })
See also panel.binned.errorbars, panel.binned.errorbars, panel.ebars and panel.ebars2.
See above
x |
= x-coordinate for the data points. |
y |
= y-coordinate for the data points. |
type |
(only one option is available, "sd"). |
err.col |
is the color of the error bar (and mean symbol) |
err.type |
is the type of plot for the mean values (e.g. "n", "p", or "b"). |
err.pch |
is the plotting symbol for mean values. |
err.cex |
is the size of the plotting symbol for the mean values. |
err.lwd |
is the line width for the error bars. |
err.width |
is the width of the error bars (i.e. the wiskers) in mm. |
err.offsetis |
an offset for the error bar relative to the mean (x). |
A Lattice panel
Claus E. Andersen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.