Clint Harshaw
2005-Mar-02 18:10 UTC
[R] .ps and .pdf page size differences in FC vs. Debian
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
Clint Harshaw
2005-Mar-02 18:39 UTC
[R] .ps and .pdf page size differences in FC vs. Debian
Clint Harshaw wrote: > R version: 2.0.0 > OS: Fedora Core 1 [...] > 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? About 15 minutes after I sent this question in to the list, I found some help at this url: http://www.ku.edu/~pauljohn/R/Rtips.html#5.4 So I tried including options(pagesize="letter") and the result properly fit on US Letter paper. But I would still like to learn how to set a configuration parameter for R, so that R code I write will behave the same regardless of my running it on my Debian box or my FC1 box. Thanks, 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
Prof Brian Ripley
2005-Mar-02 18:55 UTC
[R] .ps and .pdf page size differences in FC vs. Debian
This *is* in the R-admin manual that the INSTALL file asks you to read, and also in configure --help. There is even an loud hint for `North American readers'. If you have not read that, you need to. At this stage, go to R_HOME/etc/Renviron and change the default for R_PAPERSIZE to one of the values stated in the manual. On Wed, 2 Mar 2005, Clint Harshaw wrote:> 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?-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595