[R] suggestion: postscript paper=user
Prof Brian D Ripley
ripley at stats.ox.ac.uk
Mon Sep 6 08:39:33 CEST 1999
On Mon, 6 Sep 1999, Li Dongfeng wrote:
> "Alvaro A. Novo" wrote:
> > On Sun, 05 Sep 1999, you wrote:
> > > Dear R developers and users,
> > >
> > > I have a suggestion for the postscript device driver.
> > > Now the paer= option only support "a4", "letter",
> > > "legal", "executive". I suggest we add a "user" option
> > > and letter user provide paper size, even like "595x421",
> > > width>height.
> > >
> > > For printing purpose, the provided paper size are
> > > nearly enought. But I need to use R to produce
> > > a lot of graphics, and transform these graphics to
> > > PNG format for web publication. I use ghostscript
> > > to do the transformation, but the default paper size of the
> > > R postscript device is too big, and the orietation
> > > is not correct(we need landscape). I don't know
> > > how to make the image size smaller and
> > > rotating 90 degrees with ghostscript. I had to
> > When you issue postscript( ), use option horizontal=TRUE.
> This will cause the transformed image to be 90 degrees rotated.
That is actually what you asked for: you want a width > height aspect
ratio on a portrait plot: `landscape' means rotated (one way or the other).
> > Also, by specifying height= and width= you can get size-customized
> > images... although I am not sure that this solves your "web problem".
> The R postscript driver put the restricted graph in the middle of the
> page, and ghostscript cannot easily cut the desired region.
The real issue I think is that you need R to produce an encapsulated
postscript plot with the bounding box set to the region used. Then your (->
PNG) converter will do what you want. Until we do that (it is on the TODO
list), the simplest idea is to set the postscript bounding box yourself to
the region you want converted. If you use raw ghostscript to do the
conversion you may need to do more work, but xv and ImageMagick, for
example, convert the region inside the bounding box.
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 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help