[R] Lattice - different axis length
Weidong Gu
anopheles123 at gmail.com
Tue Feb 7 14:51:06 CET 2012
Hi,
set scales=list(x=list(relation='free')) may help.
Weidong Gu
On Tue, Feb 7, 2012 at 6:42 AM, Florian Weiler <fweiler08 at jhubc.it> wrote:
> Dear all,
>
> I have a question about the lattice package, more specifically about the
> control of the x-axis length in the different panels. I use the following
> code to make the stacked barchart:
>
> barchart(country ~ climatechangefocalpoint + meteorologyservice +
> adaptationorvulnerability + cdmcarbonmarkets + energy +
> aviationmaritimetransport + forestry + pressofficer|period, data=graph5,
> as.table=T,
> xlim=c(0,150),
> layout=c(3,1),
> par.strip.text=list(cex=1.5),
> scales = list(alternating = 3, cex=1.2, tick.number=5),
> xlab="",
>
> col=c("grey15","grey75","grey30","grey90","grey45","grey0","grey60","grey100"),
> #col=c(grey(100:1/100), grey(50:1/100), grey(0:1/100)),
> stack=T)
>
> Unfortunately, in the first two periods there are much less data, hence the
> bars are much shorter in those two panels and most of the space is unused,
> as the axis still run to 150 as for the last panel. Does anyone know how to
> cut the x-axis for the first two panels at, say, 50, while leaving it for
> the third panel as it is? Google and looking through old conversations here
> didn't help me, so I'm not quite sure whether this is possible at all.
>
> Thanks and best,
> Florian
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Lattice-different-axis-length-tp4364450p4364450.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
More information about the R-help
mailing list