Hello. First post, please excuse lack of experience. I recently switched from MS-Win to Kubuntu and find it rather difficult to recover Cran-R ease of use. The "Graphics history" facility available under Windows was, for me, extremely useful. From Murrell's 2005 book (see citation below) I understand that no such facility is available under non-Windows systems. In R-help archive, a 2000 comment from Ripley seems to confirm. (see below) Questions: - do I correctly understand that "No <Graphics history> facility is available for Linux systems"? - (if Yes above) Please, let me understand why?? Many thanks for sharing. Sincerely, Roberto Scotti ------------------------ from: http://www.stat.auckland.ac.nz/~paul/RGraphics/chapter1.pdf "1.3.2 Multiple pages of output" "For a screen device, starting a new page involves clearing the window before producing more output. On Windows there is a facility for returning to previous screens of output (see the \History" menu, which is available when a graphics window has focus), but on most screen devices, the output of previous pages is lost." ------------------------ *Subject: *Re: [R] Activating Graphics History *From: *Prof Brian D Ripley (/ripley@stats.ox.ac.uk/) *Date: *Sat 29 Jan 2000 - 08:06:24 EST * *In reply to:* Jim Ianelli: "[R] Activating Graphics History <http://tolstoy.newcastle.edu.au/R/help/00a/0196.html> Message-ID: <Pine.GSO.4.05.10001282201420.18401-100000@auk.stats> On Fri, 28 Jan 2000, Jim Ianelli wrote: /> I'm having trouble finding documentation on how / /> to activate the "record graphics history" option via / /> a command line (as opposed to having to use the menu). / ///.............../ /> But I can't find anything about setting the recording of plots / /> without using the menu. / Crucially, you did not say you were doing this on Windows, and it is only available on the windows() device on Windows. I am not aware of any way to do this. [[alternative HTML version deleted]]
On 06/09/2010 08:12 AM, Scotti Roberto wrote:> Hello. First post, please excuse lack of experience. > > I recently switched from MS-Win to Kubuntu and find it rather difficult > to recover Cran-R ease of use. > The "Graphics history" facility available under Windows was, for me, > extremely useful. > From Murrell's 2005 book (see citation below) I understand that no such > facility is available under non-Windows systems. > In R-help archive, a 2000 comment from Ripley seems to confirm. (see below) > Questions: > - do I correctly understand that "No<Graphics history> facility is > available for Linux systems"? > - (if Yes above) Please, let me understand why?? > Many thanks for sharing. > Sincerely, Roberto Scotti > > ------------------------ > from: http://www.stat.auckland.ac.nz/~paul/RGraphics/chapter1.pdf > "1.3.2 Multiple pages of output" > "For a screen device, starting a new page involves clearing the window > before > producing more output. On Windows there is a facility for returning to > previous > screens of output (see the \History" menu, which is available when a > graphics window has focus), but on most screen devices, the output of > previous > pages is lost." > ------------------------ > > *Subject: *Re: [R] Activating Graphics History > *From: *Prof Brian D Ripley (/ripley at stats.ox.ac.uk/) > *Date: *Sat 29 Jan 2000 - 08:06:24 EST > > * *In reply to:* Jim Ianelli: "[R] Activating Graphics History > <http://tolstoy.newcastle.edu.au/R/help/00a/0196.html> > > Message-ID:<Pine.GSO.4.05.10001282201420.18401-100000 at auk.stats> > > On Fri, 28 Jan 2000, Jim Ianelli wrote: > > /> I'm having trouble finding documentation on how / > /> to activate the "record graphics history" option via / > /> a command line (as opposed to having to use the menu). / > ///.............../ > /> But I can't find anything about setting the recording of plots / > /> without using the menu. / > > Crucially, you did not say you were doing this on Windows, and it is only > available on the windows() device on Windows. I am not aware of any way to > do this. >Scott, I am not aware of anything that replicates the "record graphics history" in Ubuntu. However, there are some tools/tricks that can be helpful. 1. If you run an .R file in batch mode (R CMD BATCH foo.R), any plots the code creates will be collected in the "Rplots.pdf" file. You can then use any pdf viewer to view the plots. 2. If you want to save a specific plot, try 'foo <- recordPlot()'. That will save the plot to 'foo'. To view the plot again, 'replayPlot(foo)'. 3. If you are using R interactively, if you enter the command 'pdf("Rplots.pdf")', any plot you create will be written to that file. The downside is that the plot will not be shown on the screen. However, if you open that pdf file, you can view the contents of the file as it is being updated. So, as I work in a window and create a new plot, it is appended to the pdf file and shows up a second later in the pdf viewer. You can then page through the plots. Kind of a hack, put it works. I don't think there is a way to easily plot to multiple devices, say a pdf and a X11, at the same time. There is a function plotf in the agesmisc package that appears to do this, but I haven't played with it. Hope this helps, Michael -- Dr. Michael A. Rutter School of Science Penn State Erie, The Behrend College Station Road Erie, PA 16563 http://math.bd.psu.edu/faculty/rutter
On Wed, Jun 9, 2010 at 5:42 PM, Scotti Roberto <roberto.scotti at gmail.com> wrote:> Hello. First post, please excuse lack of experience. > > I recently switched from MS-Win to Kubuntu and find it rather difficult > to recover Cran-R ease of use. > The "Graphics history" facility available under Windows was, for me, > extremely useful. > ?From Murrell's 2005 book (see citation below) I understand that no such > facility is available under non-Windows systems. > In R-help archive, a 2000 comment from Ripley seems to confirm. (see below) > Questions: > - do I correctly understand that ?"No <Graphics history> facility is > available for Linux systems"? > - (if Yes above) Please, let me understand why??The basic tools required are still available. For example, you can easily do manual (command-line) recording and replaying thus: rp <- function() { env <- environment() recorded <- list() current <- 0L record <- function() { current <<- length(recorded) + 1L recorded[[current]] <<- recordPlot() print(current) } replay <- function(n = current - 1L) { if (n > 0 && n <= length(recorded)) { current <<- n replayPlot(recorded[[current]]) } else message("'n' not in valid range: ", n) } restore <- function() replay(n = length(recorded)) showPrevious <- function() replay(n = current - 1L) showNext <- function() replay(n = current + 1L) env } rp <- rp() plot(1:10) ## plot something rp$record() ## record it plot(rnorm(10)) ## plot something else rp$record() ## record it rp$showPrevious() ## show previous plot rp$restore() ## show last recorded plot The main trick is to (1) have the plots saved automatically whenever a new page is created and (2) have a GUI interface for navigating through the history. (1) needs device support (only the device really knows when a new page is created), although you can get a partial solution using user-level hooks. (2) needs some sort of GUI interface to be available, which isn't really there for the x11 device. So in short, it's technically feasible, but not supported by the standard screen device. There are third party screen devices available, and it would be easier for them to support recording (if they don't already). -Deepayan