require(lattice) require(latticeExtra) data(mtcars) mt2 <- mtcars mt2$vs <- factor(mtcars$vs) mt2$cyl <- factor(mtcars$cyl) mt2$gear <- factor(mtcars$gear)
lp2 <- levelplot(mpg ~ cyl*gear | vs, data=mt2, strip=strip.custom(strip.names=c(TRUE,TRUE)), scales=list(x=list( relation="free", limits=list(c("2","4","6"), c("2","4"))))) update(lp2, main="distorted x scale, hence distorted areas") lp2r <- resizePanels(lp2, w=c(3,2)) update(lp2r, main="resized x scale, hence areas are consistent") On Sun, Jan 20, 2013 at 3:59 AM, ronny <ronny.recht...@evogene.com> wrote: > Hi, > > I am using levelplot, and would like remove from each panel (condition) its > unused x levels. > e.g. > Remove from panel vs=1 the cyl level=8. > data(mtcars) > levelplot(mpg~factor(cyl)*factor(gear)|factor(vs)) > > Thanks for your help, > Ronny > > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Lattice-levelplot-remove-unused-levels-per-panel-tp4656087.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. > [[alternative HTML version deleted]] ______________________________________________ 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.