Thank you Brian! This seems to do what I want for a screen device, however,
I am using this plot within Sweave, so the code in my orginal email is
within a <<>>= block. If I place a call to windows() just before I print()
the lattice plot, then I get an access denied error when generating the TeX
file, as R has not closed the PDF file. If I place a call to dev.off() just
before the end of the block, it doesnt seem to make any difference...I
presume this is because of the interaction with Sweave opening and closing
its own device within the scope of the block. Is there any solution for
this, or do I need to manually call pdf() and \includegraphics here?

Thanks
Rory

On 10/29/07, Rory Winston <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I am having a bit of difficulty with changing the canvas size on a
> trellis/lattice plot. I am plotting two "cubes" of 3-dimensional random
> numbers, as follows:
>
> library(gsl)
> library(lattice)
> q <- qrng_alloc(type="sobol", 3)
> npoints <- 200
> rs <- qrng_get(q,npoints)
>
> # Plot the normal variates in a 3-dim cube
> p1 <- cloud(rnorm(npoints) ~ rnorm(npoints) + rnorm(npoints), xlab="x",
> ylab="y",
> zlab="z", pch=21, main=paste(npoints,"3-Dimensional ~N(0,1)"))
> p2 <- cloud(rs[,1] ~ rs[,2] + rs[,3], xlab="x", ylab="y",
> zlab="z", pch=21, main=paste(npoints,"3-Dimensional Sobol"))
> print(p1, split=c(1,1,2,1), more=TRUE)
> print(p2, split=c(2,1,2,1))
>
>
> This plots fine, however the canvas size is much too large - there is a
> large amount of whitespace above and below the cloud plots. I have tried
> fiddling with the margins, e.g.
>
> trellis.par.set(layout.heights =
> list(top.padding = -20,
> main.key.padding = 1,
> key.axis.padding = 0,
> axis.xlab.padding = 0,
> xlab.key.padding = 0,
> key.sub.padding = 0,
> bottom.padding = -20))
>
> But this just moves the figure and legend around inside a fixed-size
> canvas. Does anybody know how I can set the base height and width of a
> lattice plot?
>
> Cheers
> Rory
>

        [[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.

Reply via email to