[EMAIL PROTECTED] wrote: > myYlabGrob <- > function(..., main.ylab = "") ## ...is lab1, lab2, etc > { > ## you can add arguments to textGrob for more control > ## in the next line > labs <- lapply(list(...), textGrob, rot=90) > main.ylab <- textGrob(main.ylab, rot = 90) > nlabs <- length(labs) > lab.heights <- > lapply(labs, > function(lab) unit(1, "grobheight", > data=list(lab))) > unit1 <- unit(1.2, "grobheight", data = list(main.ylab)) > unit2 <- do.call(max, lab.heights) > lab.layout <- > grid.layout(ncol = 2, nrow = nlabs, > heights = unit(1, "null"), > widths = unit.c(unit1, unit2), > respect = TRUE) > lab.gf <- frameGrob(layout=lab.layout) > for (i in seq_len(nlabs)) > { > lab.gf <- placeGrob(lab.gf, labs[[i]], row = i, col = 2) > } > lab.gf <- placeGrob(lab.gf, main.ylab, col = 1) > lab.gf > }
Wow. I don't think I would have been able to come up with that on my own. Thank you! -- Michael Hoffman ______________________________________________ R-help@stat.math.ethz.ch 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.