Hi, I'm making a multipanel lattice densityplot figure with 2 factors (3 and 20 classes in each factor) with the following statement (the type="percent" is there to prevent plotting the actual points which detract from the figure - is there another way of doing this?): densityplot(~End-Begin | Type * Chromosome, data=Mon, layout=c(5,12), xlab="Element Length",type="percent", col="grey60", strip=strip.custom(style=3, bg="grey90", par.strip.text=list(cex=0.5))) Plotting 60 panels and associated strips on a page leaves the whole thing pretty tight and so I'd like to move the 3 class factor strips to the left margin of the whole figure. Like so (pardon the ASCII art): +-+----+----+----+----+----+ + +----+----+----+----+----+ | | | | | | | +A+----+----+----+----+----+ + +----+----+----+----+----+ | | | | | | | +-+----+----+----+----+----+ + +----+----+----+----+----+ | | | | | | | +B+----+----+----+----+----+ + +----+----+----+----+----+ | | | | | | | +-+----+----+----+----+----+ + +----+----+----+----+----+ | | | | | | | +C+----+----+----+----+----+ + +----+----+----+----+----+ | | | | | | | +-+----+----+----+----+----+ Is this possible with lattice and if so, what do I need to do to get it. I've tried strip.left=TRUE and that just make the problem a horizontal one rather than a vertical one. Any help is greatly appreciated. thanks Dan
lattice multipanel strip placement - with two factors
3 messages · Baptiste Auguie, Dan Kortschak
I'm not sure I understood your problem (can you provide an reproducible example?), but perhaps you can try useOuterStrips() in the latticeExtra package (the formatting becomes similar to that of the ggplot2 package, perhaps another option to consider) Hope this helps, baptiste
On 23 Mar 2009, at 06:54, Dan Kortschak wrote:
Hi, I'm making a multipanel lattice densityplot figure with 2 factors (3 and 20 classes in each factor) with the following statement (the type="percent" is there to prevent plotting the actual points which detract from the figure - is there another way of doing this?): densityplot(~End-Begin | Type * Chromosome, data=Mon, layout=c(5,12), xlab="Element Length",type="percent", col="grey60", strip=strip.custom(style=3, bg="grey90", par.strip.text=list(cex=0.5))) Plotting 60 panels and associated strips on a page leaves the whole thing pretty tight and so I'd like to move the 3 class factor strips to the left margin of the whole figure. Like so (pardon the ASCII art): +-+----+----+----+----+----+ + +----+----+----+----+----+ | | | | | | | +A+----+----+----+----+----+ + +----+----+----+----+----+ | | | | | | | +-+----+----+----+----+----+ + +----+----+----+----+----+ | | | | | | | +B+----+----+----+----+----+ + +----+----+----+----+----+ | | | | | | | +-+----+----+----+----+----+ + +----+----+----+----+----+ | | | | | | | +C+----+----+----+----+----+ + +----+----+----+----+----+ | | | | | | | +-+----+----+----+----+----+ Is this possible with lattice and if so, what do I need to do to get it. I've tried strip.left=TRUE and that just make the problem a horizontal one rather than a vertical one. Any help is greatly appreciated. thanks Dan
______________________________________________ R-help at 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.
_____________________________ Baptiste Augui? School of Physics University of Exeter Stocker Road, Exeter, Devon, EX4 4QL, UK Phone: +44 1392 264187 http://newton.ex.ac.uk/research/emag
That's part way to my desired solution, but not completely there.
Here's an example:
chromosome<-rep(c("A","X","Y"),time=20)
type<-rep(c(1:20),times=3)
length<-rnorm(60)
densityplot(~length | type * chromosome, layout=c(5,12))
What I would like to see is the chromosome strip (A, X, Y) once on the
left as useOuterStrips() gives, but with the type strip internal as the
normal lattice function gives.
using
useOuterStrips(densityplot(~length | type * chromosome, layout=c(5,12)))
for my data (data ranges from 0-400) is about as unreadable at the
normal situation (the toy example doesn't get that across).
thanks
Dan
On Mon, 2009-03-23 at 08:40 +0000, baptiste auguie wrote:
I'm not sure I understood your problem (can you provide an reproducible example?), but perhaps you can try useOuterStrips() in the latticeExtra package (the formatting becomes similar to that of the ggplot2 package, perhaps another option to consider)