[R] Trying to tile wireframe plots (using lattice package)
Magnus Torfason
zulutime.net at gmail.com
Fri Jun 25 23:26:06 CEST 2010
Thanks, that was the pointer I needed. I'd tried the split parameter but
didn't realize that it doesn't work well within wireframe() itself,
rather, I had to call print.trellis() directly using the trellis object
that wireframe() returns if one assigns it to something.
After that, it was pretty straightforward. One issue I found surprising
was that you must pass more=TRUE to the call _before_ you want to add
more, rather than adding it to the call that is actually supposed to
draw onto a pre-existing canvas. But that was a quick fix. Here is code
that worked for me.
## Example begins
top.left = wireframe(volcano)
top.right = wireframe(volcano, shade = TRUE)
bottom.left = wireframe(volcano, shade = TRUE,
aspect = c(61/87, 0.4), )
bottom.right = wireframe(volcano, shade = TRUE,
aspect = c(61/87, 0.4), light.source = c(10,0,10))
print(top.left , split=c(1,1,2,2) , more=TRUE )
print(top.right , split=c(2,1,2,2) , more=TRUE )
print(bottom.left , split=c(1,2,2,2) , more=TRUE)
print(bottom.right , split=c(2,2,2,2) )
## Example ends
Thanks again!
Magnus
On 6/25/2010 2:59 PM, Greg Snow wrote:
> The layout function is base graphics, wireframe from lattice is
> grid based and they don't play well together without extra effort.
More information about the R-help
mailing list