Hello UseRs, I need help on how to plot several raster images (such as those obtained from a kernel-smoothed intensity function) in a layout such as that obtained from the lattice package. I would like to obtain something such as obtained from using the "levelplot" or "xyplot" in lattice. I currently use:>par(mfrow=c(3,3)to set the workspace, but the resulting plots leave a lot of blank space between individual plots. If I can get it to the lattice format, I think it will save me some white space. Any help is greatly appreciated. Neba. [[alternative HTML version deleted]]
Have you tried using the 'mai' argument to par()? Something like: par(mfrow=c(3,3), mai=c(0,0,0,0)) I've used this in conjunction with image() to plot raster data in a tight grid. <http://biostatmatt.com/archives/727> -Matt On Wed, 2010-11-03 at 11:13 -0400, Neba Funwi-Gabga wrote:> Hello UseRs, > I need help on how to plot several raster images (such as those obtained > from a kernel-smoothed intensity function) in a layout > such as that obtained from the lattice package. I would like to obtain > something such as obtained from using the "levelplot" or "xyplot" > in lattice. I currently use: > > >par(mfrow=c(3,3) > > to set the workspace, but the resulting plots leave a lot of blank space > between individual plots. If I can get it to the lattice format, > I think it will save me some white space. > > Any help is greatly appreciated. > > Neba. > > [[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.-- Matthew S. Shotwell Graduate Student Division of Biostatistics and Epidemiology Medical University of South Carolina
On Nov 3, 2010, at 11:13 AM, Neba Funwi-Gabga wrote:> Hello UseRs, > I need help on how to plot several raster images (such as those > obtained > from a kernel-smoothed intensity function) in a layout > such as that obtained from the lattice package. I would like to obtain > something such as obtained from using the "levelplot" or "xyplot" > in lattice. I currently use: > >> par(mfrow=c(3,3) > > to set the workspace, but the resulting plots leave a lot of blank > space > between individual plots. If I can get it to the lattice format, > I think it will save me some white space.(It's not clear what plotting paradigm you are using since you do not name a particular function or package, but this assumes you will be using lattice. If you are using base graphics, then the answer is undoubtedly ?par ) In the archives are examples you might use to look up in the documentation and then to modify to fit you specifications: http://finzi.psych.upenn.edu/R/Rhelp02/archive/58102.html trellis.par.set(list(layout.widths = list(left.padding = -1))) trellis.par.set(list(layout.widths = list(right.padding = -1, ylab.axis.padding = -0.5))) http://finzi.psych.upenn.edu/R/Rhelp02/archive/62912.html theme.novpadding <- list(layout.heights list(top.padding = 0, main.key.padding = 0, key.axis.padding = 0, axis.xlab.padding = 0, xlab.key.padding = 0, key.sub.padding = 0, bottom.padding = 0)) Both citations hound with search "space between lattice plots" -- David Winsemius, MD West Hartford, CT
On Wed, Nov 3, 2010 at 8:13 AM, Neba Funwi-Gabga <fusigabsmail at gmail.com> wrote:> Hello UseRs, > I need help on how to plot several raster images (such as those obtained > from a kernel-smoothed intensity function) in a layout > such as that obtained from the lattice package. I would like to obtain > something such as obtained from using the "levelplot" or "xyplot" > in lattice. I currently use: > >>par(mfrow=c(3,3) > > to set the workspace, but the resulting plots leave a lot of blank space > between individual plots. If I can get it to the lattice format, > I think it will save me some white space. > > Any help is greatly appreciated.It's not clear what your question is exactly, but you may want to look at ?panel.levelplot.raster and ?panel.smoothScatter (particularly the 'raster' argument) in lattice. -Deepayan