[R] figure margins too large

Jim Lemon jim at bitwrit.com.au
Thu Apr 3 09:02:47 CEST 2014


On 04/03/2014 04:32 PM, 张以春 wrote:
> Dear R experts,
>
>
> I tried to plot some figures in R using postscript(), but it always shows that the fugures margin is too large. I don't know how to change it. The following is my example:
>
>
>> postscript("All.eps",width=3.27,height=1.416,pointsize=12,family="Arial")
>> par(mar=c(5.1,4.5,4.1,2.1));boxplot(All~Nameall,ylab= expression(Size~ (log [10]~mm ^2)), boxwex=0.3, main="All species",col=c("red","yellow","blue"),ylim=c(0,4.0))
>> Error: plot.new() : figure margins too large
>
>
> When I run the boxplot in R, it shows well, but once I run it in the postscript, it fails. Can someone help me on it?
> Note: my operational system is windows 7.
>
>
Hi Yichun,
It is probably because you are trying to set up a very small postscript 
device, and after the margins have been allocated, there is no room for 
the plot. Try doing the plot with a larger size (e.g. width=8, height=4) 
and see if you can scale it down afterward.

Jim




More information about the R-help mailing list