[R] Lattice - different axis length

Florian Weiler fweiler08 at jhubc.it
Tue Feb 7 12:42:41 CET 2012


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.



More information about the R-help mailing list