| error_bar | R Documentation |
Creates vertical and horizontal error bars around plot points.
error_bar(object, ...)
object |
gsplot object |
... |
Further graphical parameters may also be supplied as arguments. See 'Details'. |
Additional graphical parameter inputs:
x, y location of error_bar origin
offset.up, offset.down the y-value specifying the error above the point (high) and below the point (low)
offset.right, offset.left the x-value specifying the error above the point (high) and below the point (low)
epsilon width of the end of the error bar (in inches)
legend.name name that appears in the legend, see legend for more legend parameters
gs <- gsplot()
gsNew <- points(gs, y=c(3,1,2), x=1:3, xlim=c(0,NA),ylim=c(0,NA),
col="blue", pch=18, legend.name="Points")
gsNew <- lines(gsNew, c(3,4,3), c(2,4,6), legend.name="Lines")
gsNew <- abline(gsNew, b=1, a=0, legend.name="1:1")
gsNew <- legend(gsNew, location = "topleft",title="Awesome!")
gsNew <- grid(gsNew)
gsNew <- error_bar(gsNew, 1:3, y=c(3,1,2),
offset.up=c(0.5,0.25,1), offset.down=0.1)
gsNew <- error_bar(gsNew, x=1:3, y=c(3,1,2),
offset.left=c(.2,NA,.2),
offset.right=.2, col="red",lwd=3)
gsNew <- title(gsNew, "Graphing Fun")
gsNew
yData <- rnorm(100,mean=10000, sd=1000)
gs <- gsplot() %>%
points(1:100, yData, log="y") %>%
error_bar(50:60, yData[50:60], offset.up=250)
gs
gs <- gsplot() %>%
points(1:10, 1:10) %>%
error_bar(5, 5, offset.up=1, col="green")
gs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.