[R] skip plot/blank plot on purpose (multi-plot question)

Greg Snow Greg.Snow at imail.org
Tue Jul 28 17:47:13 CEST 2009


Just to expand a little.

Your original question also asked if there is a way to specify which figure to plot in next.  If you use par(mfrow=c())  (or mfcol), then you can use par(mfg=c()) to specify which figure to plot next.

There is also the split.screen approach where you can split the device into several screens and use the screen function to specify which to plot to.  This probably gives the most control, but I have usually found layout to be sufficient and easier to use.

As has also been mentioned, lattice allows for multiple panels in a plot, but sometimes lattice is more complicated than base graphs for doing these things (and for other cases it is much simpler).

For your task, layout and plot.new is probably the most straight forward.

-- 
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 Greg Snow
> Sent: Monday, July 27, 2009 5:42 PM
> To: Mark Knecht; Bert Gunter
> Cc: r-help
> Subject: Re: [R] skip plot/blank plot on purpose (multi-plot question)
> 
> Also look at the frame and plot.new functions.
> 
> -----Original Message-----
> From: "Mark Knecht" <markknecht at gmail.com>
> To: "Bert Gunter" <gunter.berton at gene.com>
> Cc: "r-help" <r-help at r-project.org>
> Sent: 7/27/09 1:56 PM
> Subject: Re: [R] skip plot/blank plot on purpose (multi-plot question)
> 
> 
> On Mon, Jul 27, 2009 at 12:21 PM, Bert Gunter<gunter.berton at gene.com>
> wrote:
> > Well, all of this can be done quite nicely with lattice graphics:
> ?xyplot
> > (See, e.g. the "skip" argument)
> >
> >
> > 1) Is there some generic way to call plot and have it plot, but it
> > plots nothing so I don't see anything at all in position 12? This
> > could be a blank plot function I call when I notice the data set is
> > empty.
> >
> > -- But if you do not wish to learn lattice, please at least read the
> docs on
> > standard graphics: ?plot (the type argument) ?plot.default (the axes
> > argument)
> 
> 
> Thank you. It was the ?plot.default/axis argument that I was looking
> for. I knew type="n".
> 
> Cheers,
> Mark
> 
> >
> > -- Bert Gunter
> > Genentech, Inc.
> >
> > 2) Is there some generic way to specify the position number I want
> the
> > next plot to use so that I'd not plot 12 but would specify 13?
> >
> > Thanks,
> > Mark
> >
> > ______________________________________________
> > 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.
> >
> >
> 
> ______________________________________________
> 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.
> 
> ______________________________________________
> 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