groups <- rep (1 : 3, length.out = nrow (chondro))
mean.pm.sd <- aggregate (chondro, groups,
function (x) mean (x) + c(-1, 1) * sd (x))
offset <- stacked.offsets (mean.pm.sd, ".aggregate")
plot (mean.pm.sd, fill.col = matlab.palette (3), fill = ".aggregate", stacked = ".aggregate")
plot (aggregate (chondro, groups, mean), yoffset = offset$offsets, lines.args = list (lty = 2, lwd = 2), add = TRUE)
Run the code above in your browser using DataLab