Storing graphics

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

Storing graphics

JulieV
Dear R members,

I would like to store 18 graphics at the end of a loop (as we do for data frames and arrays). For each iteration, I use the function x11() and I want to keep my graphs in a single window to re-use them later. Do you know a function for storing graphics ?

Many thanks

Julie
Reply | Threaded
Open this post in threaded view
|

Re: Storing graphics

Bert Gunter
Please follow the posting guide and provide some example code.

Bottom line, most functions that "draw" a graph return a graphic
object that, like any other R object, can be given a name in the
global environment, put into a list, etc.

Alternatively, depending on what you mean -- it was not entirely clear
to me -- merely store the code that produced the objects and they can
be reproduced at will (with some possible caveats due to e.g. possible
random number generation) from the data in a saved workspace --
?save.image.

As always, a careful reading of R's docs and Help files would probably
tell you what you need to know.

-- Bert

On Wed, Dec 14, 2011 at 12:52 PM, JulieV <[hidden email]> wrote:

> Dear R members,
>
> I would like to store 18 graphics at the end of a loop (as we do for data
> frames and arrays). For each iteration, I use the function x11() and I want
> to keep my graphs in a single window to re-use them later. Do you know a
> function for storing graphics ?
>
> Many thanks
>
> Julie
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Storing-graphics-tp4196952p4196952.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [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.



--

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

______________________________________________
[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: Storing graphics

Prof Brian Ripley
Bert,

The OP may be looking for recordPlot/replayPlot.

We were not told the OS (x11 exists even on Windows).  The standard
screen devices on Windows (windows() ) and Mac OS X (quartz()) have plot
histories that can be used to flick between plots.  And 'flick' is the
operative word here: it is quick and under mouse/PgUp/PgDn control.
AFAIR Rstudio has copied the idea.

With as many as 18 plots, I would be looking for more effective ways to
browse them, and probably produce PNGs to view in an image browser or a
multi-page PDF to browse in a viewer which showed thumbnails.

On 15/12/2011 00:34, Bert Gunter wrote:

> Please follow the posting guide and provide some example code.
>
> Bottom line, most functions that "draw" a graph return a graphic
> object that, like any other R object, can be given a name in the
> global environment, put into a list, etc.
>
> Alternatively, depending on what you mean -- it was not entirely clear
> to me -- merely store the code that produced the objects and they can
> be reproduced at will (with some possible caveats due to e.g. possible
> random number generation) from the data in a saved workspace --
> ?save.image.
>
> As always, a careful reading of R's docs and Help files would probably
> tell you what you need to know.
>
> -- Bert
>
> On Wed, Dec 14, 2011 at 12:52 PM, JulieV<[hidden email]>  wrote:
>> Dear R members,
>>
>> I would like to store 18 graphics at the end of a loop (as we do for data
>> frames and arrays). For each iteration, I use the function x11() and I want
>> to keep my graphs in a single window to re-use them later. Do you know a
>> function for storing graphics ?
>>
>> Many thanks
>>
>> Julie



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