Prasenjit Kapat
2007-Mar-28 18:21 UTC
[R] is this trellis device or standard graphics device?
OK, here is the issue: I have a graphcis device (say X11) which I can set as active by dev.set(n). Is there ANY way to identify/infer whether this X11 device was obtained from a lattice function (like xyplot, levelplot...) or a standard function (like plot, scatterplot,...). A related question is whether plot.new (or frame) was called to obtain this graphics device... Thanks. PK
Paul Murrell
2007-Mar-28 23:32 UTC
[R] is this trellis device or standard graphics device?
Hi Prasenjit Kapat wrote:> OK, here is the issue: > I have a graphcis device (say X11) which I can set as active by > dev.set(n). Is there ANY way to identify/infer whether this X11 device > was obtained from a lattice function (like xyplot, levelplot...) or a > standard function (like plot, scatterplot,...).You could call the grid function getNames() and if that is zero-length, then the device is either blank or only contains traditional graphics.> A related question is whether plot.new (or frame) was called to obtain > this graphics device...Try ... recordPlot()[[1]][[1]] ... which should look something like this after plot.new() ... [[1]] .Primitive("plot.new") [[2]] NULL ... though you're starting to get on shakier ground here. Paul> Thanks. > PK > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > 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 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/