[R] plot region too large

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Sep 15 08:34:11 CEST 2006


On Fri, 15 Sep 2006, Kiermeier, Andreas (PIRSA - SARDI) wrote:

> The figure margins come from what is set in par("mar"), eg
>
>> layout(matrix(c(1:10),5,2),heights=c(1,rep(2,4)))
>> par("mar")
> [1] 5.1 4.1 4.1 2.1
>>
>
> There is not enough space left to plot anything with those margins.  You
> will need to make them smaller first, e.g.
>
>> par(mar=c(1,1,1,1,))
>> plot(1,1)
>
> In which case things work.

Or as the underlying cause is that the text is too large for a 5x2 layout, 
reduce the pointsize or increase the device region of the device in use.

Using par(mfrow/mfcol) reduces the text size for large layouts: layout() 
does not.


> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Kamila Naxerova
> Sent: Friday, 15 September 2006 13:26
> To: r-help at stat.math.ethz.ch
> Subject: [R] plot region too large
>
> Hi!
>
> I don't understand this:
>
> layout(matrix(c(1:10),5,2),heights=c(1,rep(2,4)))
> plot(1,1)
> error in plot.new() :  plot region too large
>
> Why??????


-- 
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