On Feb 23, 2011; 03:32pm Matthieu Stigler wrote:

>>> I want to have a rectangular plot of size 0.5*0.3 inches. I am having 
>>> surprisingly a difficult time to do it...
<...snip...>
>>> If I specifz this size in pdf(), I get an error... 
>>> 
>>> pdf("try.pdf", height=0.3, width=0.5) 
>>> 
>>> par(pin=c(0.5, 0.3),mai=rep(0.1,4), omi=rep(0.01,4), mar=c(5,4,4,2)) 
>>> 
>>> plot(runif(100)) 
>>> 
>>> Error in plot.new() : figure margins too large

You are specifying the margins twice, using different units, namely mai (in
inches) and mar (in lines). The latter is throwing the error. To get what
you want, try the following:

##
pdf(paper="special", file="try.pdf", height=0.5, width=0.3) 
par(pin=c(0.5, 0.3), mai=rep(0.1,4), omi=rep(0.01,4))
plot(runif(100))
dev.off()

My PDF viewer (Adobe) tells me that the page size is 0.29 x 0.50 inch.

Regards, Mark.
> dev.off()
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Set-size-of-plot-in-pdf-or-par-tp3319094p3321034.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org 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.

Reply via email to