Hi Vitalie,

what about calling "recordPlot" and then "replayPlot" after opening e.g. a
"png" device.

Quick demo:

> plot(1:3)
> t <- recordPlot(); png('dev1.png'); replayPlot(t); dev.off()
X11cairo
       2
>  abline(h = 2)
> t <- recordPlot(); png('dev2.png'); replayPlot(t); dev.off()
X11cairo
       2

Best,
Gergely



On 19 November 2013 00:50, Vitalie Spinu <spinuvit@gmail.com> wrote:

>
> Hi Everybody,
>
> I would like to add "graphics-in-emacs-window" functionality to ESS in
> near future. The most straightforward way to do that is to save graphic
> images to a disc files.
>
> Unfortunately I couldn't figure how to save buffered R devices. With
> screen devices dev.print does the job, but as screen devices are not
> available on remotes, dev.print is out of option. I didn't have luck
> with dev.copy either.
>
> So I would really appreciate if someone can suggest a way to save an
> incomplete R plot into an image file. In other words: How to write a
> function "copyDev" such that the following code
>
>     plot(1:3)
>     copyDev("dev1.png")
>     abline(h = 2)
>     copyDev("dev2.png")
>
> would generate two plots. The current devise is "pdf" or "png" or some
> other non-screen device.
>
> Any other ideas of how to implement the R-graphics-in-emacs functionally
> are very much welcome.
>
> Thanks,
>
>    Vitalie
>
> ______________________________________________
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>

	[[alternative HTML version deleted]]

