[R] .ps and .pdf page size differences in FC vs. Debian
Clint Harshaw
charshaw at presby.edu
Wed Mar 2 19:10:43 CET 2005
R version: 2.0.0
OS: Fedora Core 1
When I'm using Fedora Core 1, Rplots.ps (and subsequent Rplots.pdf
created after using ps2pdf Rplots.ps) which are created from the command
line execution of R are too large to fit on a US Letter sized page when
printed. The same code will produce a US letter sized page when I'm on
my Debian Sid box. Both boxes are connected to the same shared printer,
and both are configured in CUPS to use US Letter paper size. When I
posted a question to the FC folks, the consensus was there was a
configuration that needed to be done in R to set the proper page for
graphics exported.
I've google'd for a solution and came up with a check for a locale
variable in /etc/sysconfig/i18n to be set to the same as for the lang
variable. I tried that, and the results were still incorrectly sized.
Three sample graphs of the problem can be seen at this url:
http://penguinsolutions.org/math108/Rexamples/Rplots.pdf
Notice how the graph extends beyond the paper on the right side of each
page.
The command I am running from the terminal is:
R <baseballsalary.R >output --vanilla -q
I then read about postscript() in the documentation, so I found this
sequence to be successful:
> postscript("testthis.ps", paper='letter')
[...run all my same R code here...]
> dev.off()
> q()
and then run ps2pdf testthis.ps to create the plots as I intended on US
letter:
http://penguinsolutions.org/math108/Rexamples/testthis.pdf
Notice that the graphs do not extend beyond the edge of US letter paper
on these plots.
How do I set (in Fedora Core 1) the paper size for R to US letter, so I
can run my commands R <baseballsalary.R >output --vanilla -q from the
terminal?
Thanks very much,
Clint
--
Clint Harshaw, PhD Email: charshaw at presby.edu
Department of Mathematics Ph: 864.833.8995
Presbyterian College Fax: 864.938.3769
Clinton, SC USA 29325 Harrington-Peachtree Rm 412
More information about the R-help
mailing list