Magnus Torfason
2010-Jun-25 18:49 UTC
[R] Trying to tile wireframe plots (using lattice package)
Hi all, I'm trying to print a number of wireframe plots (generated using the lattice package), and I want them to appear in a two-by two matrix along with some other (standard) plots. In other words I am trying to create a subplot or tiled plot that works for wireframes. I've tried the methods discussed in: http://tolstoy.newcastle.edu.au/R/e2/help/07/07/21238.html but while they work for hist(), they don't work for wireframe(). I've also tried split.screen() and layout() - see below: ## Example of what I'm trying to do library(lattice) layout(matrix(c(1,2,3,4), 2, 2, byrow = TRUE)) # Top-left, as expected plot(rnorm(100),rnorm(100)) # Top-right, as expected plot(rnorm(100),rnorm(100)) # But the volcano fills the whole the device ... wireframe(volcano) ## End of example All has been to no avail up until now. I'd be grateful for any suggestions you may have. Best, Magnus ps. If there is a way to do this using intermediate files (saving each plot as a PS file, and then tiling multiple PS files within the same device), that would be a totally acceptable solution for me as well.
Greg Snow
2010-Jun-25 18:59 UTC
[R] Trying to tile wireframe plots (using lattice package)
The layout function is base graphics, wireframe from lattice is grid based and they don't play well together without extra effort. The simplest option will probably be to look at the help page for print.trellis, specifically the split and more arguments. Then look at the examples to see if this works for you in place of layout. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Magnus Torfason > Sent: Friday, June 25, 2010 12:50 PM > To: r-help at r-project.org > Subject: [R] Trying to tile wireframe plots (using lattice package) > > Hi all, > > I'm trying to print a number of wireframe plots (generated using the > lattice package), and I want them to appear in a two-by two matrix > along > with some other (standard) plots. In other words I am trying to create > a > subplot or tiled plot that works for wireframes. > > I've tried the methods discussed in: > http://tolstoy.newcastle.edu.au/R/e2/help/07/07/21238.html > but while they work for hist(), they don't work for wireframe(). > > I've also tried split.screen() and layout() - see below: > > ## Example of what I'm trying to do > library(lattice) > layout(matrix(c(1,2,3,4), 2, 2, byrow = TRUE)) > # Top-left, as expected > plot(rnorm(100),rnorm(100)) > # Top-right, as expected > plot(rnorm(100),rnorm(100)) > # But the volcano fills the whole the device ... > wireframe(volcano) > ## End of example > > All has been to no avail up until now. I'd be grateful for any > suggestions you may have. > > Best, > Magnus > > ps. If there is a way to do this using intermediate files (saving each > plot as a PS file, and then tiling multiple PS files within the same > device), that would be a totally acceptable solution for me as well. > > ______________________________________________ > 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.
Maybe Matching Threads
- Suppress only Z axis tick marks and numbers in wireframe statement
- Lattice: how to have multiple wireframe nice intersection?
- wireframe, axis label-axis separation, xlab rotation
- blank pdf output when called in a loop
- Lattice: use levelplot as panel for wireframe