geom_errorbarh {ggplot2}R Documentation

geom_errorbarh

Description

Horizontal error bars

Usage

geom_errorbarh(mapping=NULL, data=NULL, stat="identity", position="identity", ...)

Arguments

mapping mapping between variables and aesthetics generated by aes
data dataset used in this layer, if not specified uses plot dataset
stat statistic used by this layer
position position adjustment used by this layer
... ignored

Details

This page describes geom_errorbarh, see layer and qplot for how to create a complete plot from individual components.

Value

A layer

Aesthetics

The following aesthetics can be used with geom_errorbarh. Aesthetics are mapped to variables in the data with the aes function: geom\_errorbarh(aes(x = var))

Author(s)

Hadley Wickham, http://had.co.nz/

See Also

Examples

## Not run: 
df <- data.frame(
  trt = factor(c(1, 1, 2, 2)), 
  resp = c(1, 5, 3, 4), 
  group = factor(c(1, 2, 1, 2)), 
  se = c(0.1, 0.3, 0.3, 0.2)
)

# Define the top and bottom of the errorbars

p <- ggplot(df, aes(resp, trt, fill = group))
p + geom_point() +
  geom_errorbarh(aes(xmax = resp + se, xmin = resp - se))
  
last_plot() + aes(colour = group)
  
## End(Not run)

[Package ggplot2 version 0.8.5 Index]