[R] dev.print and X11(canvas = "black")

Paul Murrell p.murrell at auckland.ac.nz
Tue Mar 2 22:17:28 CET 2004


Hi


Prof Brian Ripley wrote:
 > On Tue, 2 Mar 2004, Jeffrey J. Hallman wrote:
 >
 >
 >>Jim Lemon made essentially the same suggestion: run the code that
 >>created the plot twice, once with X11 as the active device, and again
 >>with postscript as the active device.
 >>
 >>The trouble with this is that is doesn't handle plots that the user has
 >>edited.  I have some charts that users add things to interactively,
 >>using combinations of locator(), text(), mtext(), and arrows().  There's
 >>no nice way to know what a user has done to a plot before he attempts to
 >>print it.
 >
 >
 > Yes, see the sections on `Graphics hardcopy' in section A.1 of MASS4 for
 > exactly this comment: it is hardly news.
 >
 > You could record what the users do as they do it by using your own
 > versions of these functions.
 >
 >
 >>I know that R is internally maintaining a display list.  Is there a way
 >>to access that without dropping into C?  And what's in it, anyway?
 >
 >
 > Not really (recordPlot etc does), and not documented AFAIK (but Paul
 > Murrell will be able to correct me if I am wrong here).  However, I am
 > pretty sure that it has the actual plot colours and not the colour 
numbers
 > in it.


Just to confirm, the current internal display list should be considered 
a black box;  the only user-level access to it is record/replayPlot() 
and dev.copy/print/control().

Paul

p.s. If you really want to know what's in the display list, you should 
start reading at GEcreateSnapshot in R/src/main/engine.c
-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
paul at stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/




More information about the R-help mailing list