Hi I'm trying to print several plots to a multi-page postscript file. Some plots are output of basic commands, some are produced by "trellis" commands (from the package lattice). Right now I'm not able to get a straightforward black and white color scheme for the latter kind: when I open the postscript file the "trellis" plots are invisible, or parts of them are (usually the bounding box/axes/axes marks). Here is a sample set of lines: postscript(file="pix1.ps") par(mfrow=c(2,2)) plot(X,Y) plot(X1,Y1) plot(X2,Y2) par(mfrow=c(1,1)) bwplot(cut(X)~Y) bwplot(cut(X1)~Y1) dev.off() I've tried changing the trellis.settings$...$col items to "black" or specifying trellis.device(color=FALSE,device="postscript"). No luck. On a related note, is there a way to have multiple trellis plots on a same page? thanks in advance c ------------------------------------------------------------------------- claudia tebaldi NCAR RAP project scientist P.O. Box 3000 (303) 497-2830 Boulder, CO 80307 -------------------------------------------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help 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-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 13 Aug 2001, Claudia Tebaldi wrote:> Hi > > I'm trying to print several plots to a multi-page postscript file. > Some plots are output of basic commands, some are produced by "trellis" > commands (from the package lattice).That is not a good idea, and not supported under S, so I doubt if it will be under R. Write the pages separately and combine. Basically a single postscript file is from a single device session, and you want to mix sessions.> Right now I'm not able to get a straightforward black and white color > scheme for the latter kind: when I open the postscript file the "trellis" > plots are invisible, or parts of them are (usually the bounding > box/axes/axes marks). > > Here is a sample set of lines: > > postscript(file="pix1.ps") > par(mfrow=c(2,2)) > plot(X,Y) > plot(X1,Y1) > plot(X2,Y2) > > par(mfrow=c(1,1)) > > bwplot(cut(X)~Y) > bwplot(cut(X1)~Y1) > > dev.off() > > I've tried changing the trellis.settings$...$col items to "black" > or specifying trellis.device(color=FALSE,device="postscript"). No luck.(Eventually that may work, sort of.)> On a related note, is there a way to have multiple trellis plots on a same > page??print.trellis has examples .... -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help 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-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
--- Claudia Tebaldi <tebaldi at rap.ucar.edu> wrote:> Hi > > I'm trying to print several plots to a multi-page > postscript file. > Some plots are output of basic commands, some are > produced by "trellis" > commands (from the package lattice). > Right now I'm not able to get a straightforward > black and white color > scheme for the latter kind: when I open the > postscript file the "trellis" > plots are invisible, or parts of them are (usually > the bounding > box/axes/axes marks). > > Here is a sample set of lines: > > postscript(file="pix1.ps") > par(mfrow=c(2,2)) > plot(X,Y) > plot(X1,Y1) > plot(X2,Y2) > > par(mfrow=c(1,1)) > > bwplot(cut(X)~Y) > bwplot(cut(X1)~Y1) > > dev.off()Mixing regular R graphics and grid/lattice graphics are not fully supported yet (we hope to have some support in the next release). There is a way though, which is to use the grid functions grid.stop() and grid.start(). You have to first start the device by trellis.device() (otherwise the trellis settings for that device might not take effect). That will start grid graphics. You might now use lattice calls. Call grid.stop() before starting regular graphics calls and then grid.start() again to return to lattice. For example, this should give you what you want:> ##postscript(file="pix1.ps") replaced by: > trellis.device(postscript, file="pix1.ps",+ color=F, bg="white")> grid.stop() # added > par(mfrow=c(2,2)) > plot(X,Y) > plot(X1,Y1) > plot(X2,Y2) > > par(mfrow=c(1,1)) > > grid.start() # added > bwplot(cut(X)~Y) > bwplot(cut(X1)~Y1) > > dev.off()> I've tried changing the trellis.settings$...$col > items to "black" > or specifying > trellis.device(color=FALSE,device="postscript"). No > luck. > On a related note, is there a way to have multiple > trellis plots on a same > page?print.trellis() with arguments position or split. __________________________________________________ Do You Yahoo!? Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help 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-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._