search for: myprepanelfunc

Displaying 1 result from an estimated 1 matches for "myprepanelfunc".

2007 Feb 24
2
barchart (lattice) with text labels
I would like to place the value for each bar in barchart (lattice) at the top of each bar. Something like the following code produces. library(lattice) mypanelfunc <- function(x, y, ...) { panel.barchart(x, y, ...) panel.text(x, y, labels=as.character(round(x,2)), ...) } myprepanelfunc <- function(x, y, ...) list(xlim=c(0, max(x)+.1)) mydata <- expand.grid(a=factor(1:5), b=factor(1:3), c=factor(1:2)) mydata$x <- runif(nrow(mydata)) barchart(a~x|b, mydata, groups=c, panel=mypanelfunc, prepanel=myprepanelfunc, adj=c(-0.1,0.5)) However, I cannot figure out how to shift t...