[R] Going "backwards" through plot panels

R. Michael Weylandt michael.weylandt at gmail.com
Wed Jun 20 23:27:05 CEST 2012


R-helpers,

I'm looking to set up multi-screen plots with layout() or
par(mfrow/mfcol = ) but I'm not sure if there's an easy way to go
"backwards" among the panels. E.g.

layout(1:2)
plot(1:4)
plot(1:8)

Here I'd like to put some more on the 1:4 plot (e.g., some points or a
line or a legend) but everything goes onto the now active panel. I'm
really looking for something like dev.set() but for the panels on a
single device.

I know the immediate work around is simply to do all that's necessary
for each panel in the right order, but I'm setting up some
end-user-facing plot functions and that might not be the easiest to
ask of them. For speed / style / consistency, I'd really like to stay
with base graphics, so a grid solution unfortunately isn't quite what
I need.

Happy to be told to RTFM if someone has a pointer to the right one,

Michael



More information about the R-help mailing list