Last data update: 2014.03.03

R: Error bar plot
error.barR Documentation

Error bar plot

Description

Make an X-Y plot with error bars.

Usage

error.bar(x, y, lo, hi, pch = 1, col =1, barw = 0.1, add = FALSE, ...)

Arguments

x

X-values

y

Y-values

lo

Lower limit of error bars

hi

Upper limit of error bars

pch

plotting character

col

color

barw

width of the bar

add

logical, add=FALSE starts a new plot

...

other plotting parameters

Value

graphical side effects

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

Examples

x = 1:10
y = 2*x+5
zup = rnorm(10)
zup = zup-min(zup)+.5
zdown = rnorm(10)
zdown = zdown-min(zdown)+.2
####  example with same error on either side:
error.bar(x, y, y-zup, y+zup, pch = 1, col = 'brown' , barw = 0.1, add =
FALSE)
####  example with different  error on either side:
error.bar(x, y, y-zdown, y+zup, pch = 1, col = 'brown' , barw = 0.1, add
= FALSE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ClamR)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ClamR/error.bar.Rd_%03d_medium.png", width=480, height=480)
> ### Name: error.bar
> ### Title: Error bar plot
> ### Aliases: error.bar
> ### Keywords: misc
> 
> ### ** Examples
> 
> x = 1:10
> y = 2*x+5
> zup = rnorm(10)
> zup = zup-min(zup)+.5
> zdown = rnorm(10)
> zdown = zdown-min(zdown)+.2
> ####  example with same error on either side:
> error.bar(x, y, y-zup, y+zup, pch = 1, col = 'brown' , barw = 0.1, add =
+ FALSE)
> ####  example with different  error on either side:
> error.bar(x, y, y-zdown, y+zup, pch = 1, col = 'brown' , barw = 0.1, add
+ = FALSE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>