[R] mfrow is ignored by some plots

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jul 19 12:50:26 CEST 2007


I'd ask the plotrix maintainer to fix his code!

radial.plot saves and restores all the par() values, including mfrow and 
mfg. When you do par(mfrow=c(2,2)) the plot position is reset to the 
bottom right, and the next plot will advance to the top left (but 
par(new=TRUE) negates that).

Please restore only the par values you have changed, not all the 
no.readonly ones.  That values can be set does not make it a good idea to 
do so.

On Thu, 19 Jul 2007, Jim Lemon wrote:

> Hi all,
> I was just informed that the plots in the radial.plot family in the
> plotrix package do not plot correctly when using mfrow or mfcol to
> subdivide the plot window. I found one related message, an answer from
> Deepayan Sarkar to a question about lattice graphics, but that shed no
> light on this problem.
>
> If I invoke par(mfrow=c(2,2)) and run radial.plot a few times, the plots
> appears in the upper left corner. _Sometimes_ the second plot appears in
> the upper right corner once, but then returns to the upper left. If I
> invoke par(new=TRUE), the plots appear in the lower right corner.
>
> For instance, the following just keeps writing the plots in the upper left.
>
> par(mfrow=c(2,2))
> radial.plot(rnorm(7),0:6,line.col="red",lwd=2)
> radial.plot(rnorm(7),0:6,line.col="red",lwd=2)
> radial.plot(rnorm(7),0:6,line.col="red",lwd=2)
> radial.plot(rnorm(7),0:6,line.col="red",lwd=2)
>
> If I then enter:
>
> par(new=TRUE)
>
> and repeat the plots, they all accumulate in the lower right. I think
> this may have something to do with the calls to points or lines or
> symbols within radial.plot, but I could find no information on this in
> the help for plot, par, or several other pages.
>
> Any clues?
>
> Jim
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list