[R] convert lines to inches

Thomas Steiner finbref.2006 at gmail.com
Sun Oct 19 13:23:03 CEST 2008


Ok, thanks Peter, I try to be more accurate:

pdf("test.pdf",width=(20+2+4)/2.54,height=(10+3+1)/2.54)
x=seq(0,pi,length=100)
par( mai=c(2,3,4,1)/2.54 )
plot(x,cos(x),type="l",xlim=c(0,3),ylim=c(-1.2,1.2),xaxs="i",yaxs="i",asp=1)
conv=par("mar")/par("mai")
box("figure", col="darkblue")
dev.off()

Then figure has as expected the size 26x14cm.
But the size of the *Plot Area* is not as expected 20x10cm, but
22x8cm, although I chose the margins in inches as 2 and 4 cm below and
above (=26-(2+4)). Probably I confuse something with lines and inches.
I'd like to have a plot area of 20x10cm and around it a (2,3,4,1)cm
margin.
Thanks for hints and have a nice Sunday,
Thomas



More information about the R-help mailing list