Hi,

How can I, given the code snippet below, draw the error bars in the center 
of each grouped bar rather than in the center of the group?

Thanks for any hints,

Joh

library(lattice)

barley[["SD"]] <- 5
barchart(
  yield ~ variety | site, 
  data = barley,
  groups=year,
  origin=0,
  lowDev=barley[["SD"]],
  highDev=barley[["SD"]],
  panel = function(
    x,
    y,
    ...,
    lowDev,
    highDev
  ){
    panel.barchart(x, y, ...)
    panel.segments(
       as.numeric(x),
       as.numeric(y) - lowDev,
       as.numeric(x),
       as.numeric(y) + highDev,
       col = 'red', lwd = 2,
       ...)
  }
)

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to