Hi I had two questions regarding plots: * Is there are way to save a plot in the form of an object such that it could be displayed/modified later? * I've been using Minitab for some work and I found the burshing capability very handy (it allows me to choose a point on the graph and displays the data associated with it - x,y and other user associated data). I know that this feature is available in XGobi but I was wondering if a simplified form of brushing would be possible in R. I know there are GUI's for R but I was rather thinking of a small Tk based function which would basically work with a plot and somehow recieve mouse clicks on the plot and use identify to get the X,Y data. Does anybody know whether this has been done (or is indeed possible)? Thanks, ------------------------------------------------------------------- Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net> GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE ------------------------------------------------------------------- A beer delayed is a beer denied.
First question: dev.control(displayList = "enable") # turn on displaylist plot(1:3) myplot <- recordPlot() plot(1:4) myplot # plot(1:3) is back up Second question: ?identify ?locator --- Date: Thu, 26 Feb 2004 15:47:14 -0500 From: Rajarshi Guha <rxg218 at psu.edu> To: R <r-help at stat.math.ethz.ch> Subject: [R] saving plots as objects? Hi I had two questions regarding plots: * Is there are way to save a plot in the form of an object such that it could be displayed/modified later? * I've been using Minitab for some work and I found the burshing capability very handy (it allows me to choose a point on the graph and displays the data associated with it - x,y and other user associated data). I know that this feature is available in XGobi but I was wondering if a simplified form of brushing would be possible in R. I know there are GUI's for R but I was rather thinking of a small Tk based function which would basically work with a plot and somehow recieve mouse clicks on the plot and use identify to get the X,Y data. Does anybody know whether this has been done (or is indeed possible)? Thanks, ------------------------------------------------------------------- Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net>; GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE ------------------------------------------------------------------- A beer delayed is a beer denied.
On Thursday 26 February 2004 14:47, Rajarshi Guha wrote:> Hi I had two questions regarding plots: > > * Is there are way to save a plot in the form of an object such that it > could be displayed/modified later?Depends on what you want to do. Probably not for regular (base) plots. The grid package has a concept of objects that can be edited (before and/or after plotting them). Functions in the lattice package produce objects that may be close to what you want. They are not plots themselves, but rather a self-contained description of a plot (in the sense that they contain the data as well as instructions on how to plot it). The data part cannot be easily changed, but almost everything else can be manipulated before plotting. Deepayan
On Thu, 26 Feb 2004, Deepayan Sarkar wrote:> On Thursday 26 February 2004 14:47, Rajarshi Guha wrote: > > Hi I had two questions regarding plots: > > > > * Is there are way to save a plot in the form of an object such that it > > could be displayed/modified later? > > Depends on what you want to do. Probably not for regular (base) plots.I think ?recordPlot does this, at least to allow plots to be saved, displayed again and added to.> The > grid package has a concept of objects that can be edited (before and/or > after plotting them). Functions in the lattice package produce objects > that may be close to what you want. They are not plots themselves, but > rather a self-contained description of a plot (in the sense that they > contain the data as well as instructions on how to plot it). The data part > cannot be easily changed, but almost everything else can be manipulated > before plotting.AFAIK that internal description is not documented and there are no end-user tools for doing the manipulation. Can you please point us to details? I suspect nothing can _easily_ be changed by end-users at present. -- 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