[R] probleme with savePlot (to eps)
Prof Brian Ripley
ripley at stats.ox.ac.uk
Mon Mar 2 08:14:55 CET 2009
I don't see an OS mentioned in this thread. There are two separate
functions called savePlot(), one for Windows devices and one for
cairo-based X11(); the latter being quite recent.
We do ask for 'at a minimum information' in the posting guide, and
providing this helps the readers to know which functions are being
asked about.
Basically savePlot works by copyig the internal bitmap representation
of the screeen image to a file. However, on Windows (because this is
used for the menus of the windows() device), it also implements an
internal form of dev.copy.
If you want to copy a screen device to postscript portably, use
dev.copy2eps().
On Sun, 1 Mar 2009, David Winsemius wrote:
> Unfortunately your burning desire to use savePlot for this purpose is not
> going to reconfigure the capabilities of that function. Just read the help
> page of savePlot:
>
> savePlot {grDevices}
> R Documentation
> Save Cairo X11 Plot to FileDescription
> Save the current page of a cairo X11() device to a file.
>
> Usage
> savePlot(filename = paste("Rplot", type, sep="."), type = c("png", "jpeg",
> "tiff", "bmp"), device = dev.cur())
> ====
> Do you see "ps" or "eps" in the supported types? I do not. Why would you
> expect be a warning not to use a type of device that was not documented as
> possible.
> Have you looked at dev.copy or dev.print as a method of getting the user
> choice of screen displayed graphics to an output file?
> --
> David Winsemius
>
>
>
> On Mar 1, 2009, at 6:02 PM, Christophe Genolini wrote:
>
>> Thanks for your answer.
>>> Use the postscript device to save .ps or .eps files.
>> Unfortunatly, I can't. I am using savePlot in a package. Several graphs (up
>> to 100) are exported at the same time and I would like the user to chose
>> the extension. It is why I need savePlot.
>>
>> Beside, I did not find any warning again postscript in the help page for
>> savePlot. Where did you get this information ? I am using R 2.8.1
>>
>> Christophe
>>> The help page for savePlot does not suggest that it would be of any value
>>> in saving plots as postscript files.
>>>
>>> ?postscript
>>> ?Devices
>>>
>>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
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
More information about the R-help
mailing list