[R] Storing graphics

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Dec 15 06:45:01 CET 2011


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<sharkette002 at hotmail.com>  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,                  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



More information about the R-help mailing list