Re: [R] graphics history

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Mon, 21 Apr 2008 13:16:39 +0100 (BST)

On Mon, 21 Apr 2008, Duncan Murdoch wrote:

> On 21/04/2008 4:59 AM, Norbert NEUWIRTH wrote:
>> dear useRs and developeRs,
>>
>> I am afraid it is a very basic question, but I did not find anything alike in the literature.
>>
>> The R standard graphics device shows the opportunity to activate the
>> history of plots drawn within the current session. Th user can scroll
>> back and see the last graphs (or same graph with some changes in
>> parameters). I did not find out yet how to activate the history by
>> code. Any ideas?
>
> When you open the window, use windows(record=TRUE).
>
> If you want this to happen by default, write your own wrapper for the
> windows() graphics device:
>
> windows <- function(..., record=TRUE)
> grDevices::windows(..., record=record)

Or in 2.7.0, windows.options(record=TRUE) sets this for the session. You can set this in a .Rprofile file by (untested, I am not on Windows)

setHook(packageEvent("grDevices", "onLoad"),

         function(...) grDevices::windows.options(record=TRUE)
         )

> One thing I'd like to do, but didn't have time to implement before
> 2.7.0, is to have history set to some finite size, e.g. a default might
> be the last 3 or 10 plots. The problem with record=TRUE is that it
> keeps a record of all the plots, so memory use just increases and increases.

Why not just startup another device with record=FALSE?

>
> Duncan Murdoch
>
> ______________________________________________
> R-help@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

______________________________________________
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.
Received on Mon 21 Apr 2008 - 12:19:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 Apr 2008 - 13:30:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive