[R] Using dev.copy
p.murrell at auckland.ac.nz
Wed Mar 24 23:12:09 CET 2010
Dan Davison wrote:
> I'm working over an ssh connection without X11 graphics. I'm making a
> plot, the first stage of drawing which takes a long time. I want to
> experiment with adding details. Here is what I was hoping to do, which
> results in error.
> ## Draw the master plot on png dev 2
> ## Save a copy on png dev 3
> ## Add details to copy, write to disk and view
> Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
> plot.new has not been called yet
> Can someone tell me how to do this correctly?
The problem is that the "display list" is turned off by default for
png() devices, so there is no record of what has been drawn, so when you
do dev.copy(), there is nothing to copy. If you turn the display list
on, it should work much better ...
## TURN DISPLAY LIST ON
## Save a copy on png dev 3
## Add details to copy, write to disk and view
... hope that helps.
> Thanks a lot,
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
64 9 3737599 x85392
paul at stat.auckland.ac.nz
More information about the R-help