Martin Maechler
1998-Jan-12 16:38 UTC
Default device instead of ``No graphics device is active''
in RHOME/src/ : grep DevInit */*.[ch] reveals only a few calls such as if(!DevInit) error("No graphics device is active\n"); (in graphics/graphics.c and main/par.c). Couldn't we startup a default device instead of having the error message? The Default device would be Unix, interactive: x11 Unix, batch: postscript Win, interactive: windows Win, batch: postscript ?? Mac, interactive: macintosh Mac, batch: postscript ???? [ one could even define default.device <- x11 in Rprofile.unix, etc. and have the same .First function (which could be moved out of profile to base .First <- function() if(interactive()) default.device() ] -- If I remember properly, this is also how S4 behaves.. Martin -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter Dalgaard BSA
1998-Jan-12 17:02 UTC
Default device instead of ``No graphics device is active''
Martin Maechler <maechler@stat.math.ethz.ch> writes:> Couldn't we startup a default device instead of having the error message?Very good idea!> The Default device would be > > Unix, interactive: x11or: "none" (or "printer"???) if DISPLAY not set, or maybe customizable (sometimes you really don't want it, e.g. when connected to Auckland from Europe...)> .First <- function() if(interactive()) default.device()Actually, it might be a better idea to use this to *get rid* of the initial graphics startup. I, for one, tend to get annoyed at seeing the window popup, even when what I am trying to do has nothing to do with graphics. Having to place it manually doesn't help... While we're at this, how about making it possible to override the printer and device orientation in print.plot() and save.plot()? -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thomas Lumley
1998-Jan-12 17:07 UTC
Default device instead of ``No graphics device is active''
On Mon, 12 Jan 1998, Martin Maechler wrote:> in RHOME/src/ : > grep DevInit */*.[ch] > reveals only a few calls such as > > if(!DevInit) error("No graphics device is active\n"); > > (in graphics/graphics.c and main/par.c). > > Couldn't we startup a default device instead of having the error message?yes, though I think the default device for batch processing should do nothing or just emit warnings -- if postscript() is the default then you might overwrite the previous contents of an output file. At least if it is going to be postscript() it should use a unique file name. It should be relatively easy to define a none() device that does absolutely nothing (a simple but inefficient one would be postscript("/dev/null") under Unix) -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._