Re: [R] How to restore and edit saved graphics?

About this list Date view Thread view Subject view Author view Attachment view

From: Gabor Grothendieck (ggrothendieck@myway.com)
Date: Mon 17 May 2004 - 01:40:37 EST


Message-id: <loom.20040516T173340-38@post.gmane.org>


I don't think you can produce a graphic in R and then easily edit it
*in R* to change the title and so on; however, if you are using Windows you
can save the graphic as a Windows metafile (right click graphic and
save as a Windows metafile or just copy it as Windows metafile to clipboard)
and then import or paste it into Word and change
everything you want. The titles, etc. will be accessible as separate
objects and you can easily change them and their properties. Its
remarkably easy to do.

This should actually be possible for any vector format provided you
have a vector editor for it so there are undoubtedly solutions
involving SVG and other vector formats too.

Shin, Daehyok <sdhyok <at> catchlab.org> writes:

:
: Thanks for the interesting solution.
: I am happy to find a way to save all graphic options into a file.
: There is a minor glitch.
: Is there is any way to replace title, not to overwrite it?
: And if I want to change the color of a line or the ranges of x or y axis,
: how can I do it with the restored plot?
:
: Interestingly, there is no mention about dev.control() in the help document
: of recordPlot(). I think it should be there.
:
: Thanks again.
:
: Daehyok Shin (Peter)
:
: > -----Original Message-----
: > From: r-help-bounces <at> stat.math.ethz.ch
: > [mailto:r-help-bounces <at> stat.math.ethz.ch]On Behalf Of Gabor
Grothendieck
: > Sent: Saturday, May 15, 2004 PM 11:59
: > To: r-help <at> stat.math.ethz.ch
: > Subject: Re: [R] How to restore and edit saved graphics?
: >
: >
: > Saving of the low level graphics that R displays can be
: > 1. turned on with dev.control(displaylist="enable") and
: > 2. turned off with dev.control(displaylist="inhibit").
: > recordPlot() can be used to save the display list in a variable.
: >
: > For example:
: >
: > # turn on display list, perform plot, turn off display list, add title
: > # do not need next line if graphics device already active
: > windows() # or x11() on unix
: > dev.control(displaylist="enable")
: > plot(1:10)
: > myplot <- recordPlot()
: > dev.control(displaylist="inhibit")
: > title(main="My Title")
: >
: > # now redisplay plot as it was before title and reissue title
: > myplot
: > title(main="My Other Title")
: >
: > Shin <sdhyok <at> email.unc.edu> writes:
: >
: > :
: > : I am looking for a function to restore saved graphics for further
: > : editing, such as changing its title, labels, or legend.
: > : How can I do it in R? Thanks in advance.

:

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:11 EST