[R] convert lines to inches

Thomas Steiner finbref.2006 at gmail.com
Sun Oct 19 10:39:38 CEST 2008


how can I convert the unit "lines" of par("mar") into inches?
par("mai") could help, but does not (see code below).

I want to plot a curve in a predefined size in pdf (I add some margin
space to the plot width&height, everything is in cm):
plot(10:30, 9*cos(10:30),type="l",xlim=c(10,30),ylim=c(-10,15),xaxs="i",yaxs="i",asp=1)
box("figure", col="darkblue")

The size of the darkblue box is fine, but I cannot yet control the
size of the plot area (although
helped me a lot). And seeting the mar to zero (#) works in a R figure,
but not in a pdf. Why?

I already asked ("draw a 5cm x 3cm rectangle") a related question
three days ago, but I was unable to get a more complicated example in
the grid package (solution there) running.

Thanks for giving hints,

More information about the R-help mailing list