Re: [R] Error in plot.new() : Figure margins too large

From: Peter Dalgaard <P.Dalgaard_at_biostat.ku.dk>
Date: Thu 11 Jan 2007 - 13:31:11 GMT

Antje wrote:
> Hmm, but what can be the solution? Any idea? Or any documentation on
> that which I could read to find a solution by myself?
>
> with the windows statement, I wanted to achive a format which fits for
> my plots, so that each plot will have a quadratic area.
>
OK, so what was the pdf() for?...

Notice that this creates subplots which are one inch square. By default plots are surrounded by 9.2 lines of text vertically (and 6.2 horisontally). Now the distance between lines of text depends on the pointsize, which is 12pt by default. In subplots, I believe it is somewhat smaller (8pt?), but 9.2 lines of text still leaves no room for the actual plot. So, look at help(par) and help(windows) and start fiddling with pointsize, mar, mgp, and maybe more.
> I guess, I did not unstand that much of windows / margins and plotting
> areas. Maybe someone can help me (even with a good overview on these
> basics...)
>
> Antje
>
>
>
> Peter Dalgaard schrieb:
>
>> Antje wrote:
>>
>>> Hello,
>>>
>>> was could be the reason for such an error message???
>>>
>>>
>> Generically, that the (per-subplot) figure region is so small that
>> subtracting margins leaves nowhere to plot. Reasons include: Plotting
>> area too small, too many subplots, too many lines of text in margins,
>> too large font size in margins.
>>
>>
>>> I'd like to create a window with 10x6 barplot and save it as pdf.
>>>
>>> I tried:
>>>
>>> pdf("histogram.pdf",width=7, height=7)
>>>
>>>
>> What did you expect the following line to do? I think it doesn't...
>>
>>> windows(cols, rows)
>>>
>>>
>>
>>> par(mfcol = c(rows,cols))
>>>
>>> sapply(mat, calcHist)
>>>
>>> dev.off()
>>>
>>> Within the method of sapply, I call barplot
>>>
>>> What is wrong???
>>>
>>> Antje
>>>
>>> ______________________________________________
>>> R-help@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.
>>>
>>>
>>
>
> ______________________________________________
> R-help@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.
>

-- 
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-help@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.
Received on Fri Jan 12 00:46:57 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 11 Jan 2007 - 14:00:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.