[R] reducing space between charts in lattice graphics

Gabor Grothendieck ggrothendieck at gmail.com
Sat Sep 19 18:55:45 CEST 2009


xyplot.zoo does that by default.

library(lattice)
library(zoo)
z <- zoo(cbind(1:4, 2:5, 3:6))

xyplot(z, type = "l")


On Sat, Sep 19, 2009 at 12:42 PM, Larry White <ljw1001 at gmail.com> wrote:
> Hi,
>
> I'm trying to create a lattice plot with three xyplots in one vertical
> column. I would like to reduce the vertical space between the charts.  My
> code is below. There seems to be a "between" parameter for lattice.options,
> but I can't find any examples. Aside from the data setup, the code is below.
> Can anyone provide an example showing how to reduce the white space between
> the charts?  Thanks.
>
> total_chart <- xyplot(total ~ date,
> xlab=list(label=""),
> ylab=list(label="Total Work")
> )
>
> balance_chart <- xyplot(bal ~ date,
> xlab=list(label=""),
> ylab=list(label="Remaining Work")
> )
>
> index_chart <- xyplot(index ~ date,  col="red", type="b", pch=15)
>
> print(total_chart, split=c(1,1,1,3),   position=c(0, 0, 1, 1),
> newpage=FALSE, more=TRUE)
> print(balance_chart, split=c(1,2,1,3), position=c(0, 0, 1, 1),
> newpage=FALSE, more=TRUE)
> print(index_chart, split=c(1,3,1,3),   position=c(0, 0, 1, 1), newpage=TRUE,
> more=FALSE)
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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