-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy patherror_bar.Rd
More file actions
41 lines (37 loc) · 1.17 KB
/
error_bar.Rd
File metadata and controls
41 lines (37 loc) · 1.17 KB
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
32
33
34
35
36
37
38
39
40
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/error_bars.R
\name{error_bar}
\alias{error_bar}
\title{gsplot error bars}
\usage{
error_bar(object, ...)
}
\arguments{
\item{object}{gsplot object}
\item{\dots}{Further graphical parameters may also be supplied as arguments. See 'Details'.}
}
\description{
Creates vertical and horizontal error bars around plot points.
}
\examples{
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), y.high=c(0.5,0.25,1), y.low=0.1)
gsNew <- error_bar(gsNew, x=1:3, y=c(3,1,2), x.low=c(.2,NA,.2), x.high=.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], y.high=250)
gs
gs <- gsplot() \%>\%
points(1:10, 1:10) \%>\%
error_bar(5, 5, y.high=1)
gs
}