On Wed, Sep 17, 2008 at 1:25 PM, Deepayan Sarkar <[EMAIL PROTECTED]> wrote: > On Wed, Sep 17, 2008 at 1:12 PM, David Carslaw > <[EMAIL PROTECTED]> wrote: >> >> I think this is a very useful function that I imagine has wide appeal - >> thanks. Using the code below produces the plot OK but when I try and >> copy/save it (as a metafile) I receive the following error and an hourglass: >> >> Error: invalid graphics state >> >> [using XP, 2.72, lattice 0.17.13] > > Yes, that's the drawback of mixing grid and base graphics (even > resizing the screen device will not work). However, if you explicitly > start a device and plot to it, instead of copying from a screen > device, that should work fine.
That isn't completely accurate. To ensure that the plot doesn't start a new page, you need something like pdf() plot.new() levelplot(volcano, panel = panel.filledcontour, col.regions = terrain.colors, cuts = 25, plot.args = list(newpage = FALSE)) dev.off() -Deepayan ______________________________________________ R-help@r-project.org 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.