graphics history

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

graphics history

Norbert NEUWIRTH-2
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?

Thanks and best regards,

Norbert


--
**********************************************************
Mag. Norbert Neuwirth

Österreichisches Institut für Familienforschung (ÖIF) - Universität Wien
Austrian Institute for Family Studies - University of Vienna

http://www.oif.ac.at

e-mail:    [hidden email]
tel:          +43-1-4277-489-11
fax:         +43-1-4277-9-489
address:  A-1010 Wien, Grillparzerstraße 7/9

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: graphics history

Søren Højsgaard
On windows you can go to the graphics window; click history -> recording. You may also want to have a look at recordPlot() and replayPlot().
Regards
Søren

________________________________

Fra: [hidden email] på vegne af Norbert NEUWIRTH
Sendt: ma 21-04-2008 10:59
Til: [hidden email]
Emne: [R] graphics history



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?

Thanks and best regards,

Norbert


--
**********************************************************
Mag. Norbert Neuwirth

Österreichisches Institut für Familienforschung (ÖIF) - Universität Wien
Austrian Institute for Family Studies - University of Vienna

http://www.oif.ac.at <http://www.oif.ac.at/>

e-mail:    [hidden email]
tel:          +43-1-4277-489-11
fax:         +43-1-4277-9-489
address:  A-1010 Wien, Grillparzerstraße 7/9

______________________________________________
[hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: graphics history

Duncan Murdoch
In reply to this post by Norbert NEUWIRTH-2
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)

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.

Duncan Murdoch

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: graphics history

Prof Brian Ripley
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
>
> ______________________________________________
> [hidden email] 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,                  [hidden email]
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

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: graphics history

Duncan Murdoch
On 4/21/2008 8:16 AM, Prof Brian Ripley wrote:

> 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?

I'd like to have recording always on, but I don't need an infinite
history.  But this isn't urgent enough to have prodded me into writing
it before now.

Duncan Murdoch

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: graphics history

Mike Prager
Duncan Murdoch <[hidden email]> wrote:

> >> 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?
>
> I'd like to have recording always on, but I don't need an infinite
> history.  But this isn't urgent enough to have prodded me into writing
> it before now.

A finite size would be nice.  I've been using this code in
scripts:

graphics.off()
windows(record = TRUE)
.SavedPlots <- NULL

Not exactly the same thing, but it limits memory use.

Are there side effects that could bite me?

--
Mike Prager, NOAA, Beaufort, NC
* Opinions expressed are personal and not represented otherwise.
* Any use of tradenames does not constitute a NOAA endorsement.

______________________________________________
[hidden email] 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.