Hi
Shin, Daehyok wrote:
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?
The grid graphics package provides support for this sort of thing. If you have R 1.9.0 there are some vignettes describing grid and how to do this sort of thing in grid -- see vignette("grid") and vignette("interactive") for a start.
This may or may not be sufficient for your purposes right now -- grid doesn't give you any high-level plots and, although the lattice package does give you high-level plots, it doesn't make use of the bits of grid that would allow this sort of interaction just yet (we're working on it) -- so its immediate usefulness will depend on what you're trying to do.
Paul
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Gabor Grothendieck Sent: Saturday, May 15, 2004 PM 11:59 To: [EMAIL PROTECTED] 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. :
______________________________________________ [EMAIL PROTECTED] 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
______________________________________________ [EMAIL PROTECTED] 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
-- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] http://www.stat.auckland.ac.nz/~paul/
______________________________________________ [EMAIL PROTECTED] 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