addErrorBars | R Documentation |
Adds upper-lower error bars to data in a graph.
addErrorBars(x, yup, ylo, Bars = list(name = "", cap = 0.09, width = "standard", color = "black"), current = list(yaxis.log = FALSE, yaxis.rev = FALSE, xaxis.log = FALSE))
x |
the x-coordinate data. Missing values are permitted but result in no bar. |
yup |
the upper limit of the error bar. Missing values are permitted but result in no bar. |
ylo |
the lower limit of the error bar. Missing values are permitted but result in no bar. |
Bars |
parameters defining the characteristics of the error bars. See Details. |
current |
the current plot information. Typically, this would be the
output from one of the graph creation functions like |
The Bars
argument must be a tagged list with these components:
a name describing the data; used in the explanation.
the width of each cap on the error bar.
the width of the lines drawn for the error bars.
the name of the color to draw the error bars.
The current plot information is returned invisibly.
The error bars are plotted on top of any current symbol. To plot the
symbol on top of the error bar, start with the argument
Plot=list(what="none")
in the original call to xyPlot
or
timePlot
and then add the symbols with a call to addXY
. Note
that this is only necessary if the color of the symbol and the color of the
error bars are different.
The symbol drawn for errors bars in the explantion does not have caps due to a
limitation in the system for creating the explanation.
xyPlot
, timePlot
, addXY
,
xyPlot
## Not run: set.seed(1) X <- seq(1, 9, by=1.0) Y1 <- runif(9) Y2 <- runif(9) Y <- (Y1 + Y2)/2 Ymin <- pmin(Y1, Y2) Ymax <- pmax(Y1, Y2) setGD() AA.pl <- xyPlot(X, Y, yaxis.range=c(0,1)) addErrorBars(X,Ymax, Ymin) # For more details of addErrorBars see vignette(topic="GraphGallery", package="smwrGraphs") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.