[R] lattice problems under Win2K and R-1.4.0

Deepayan Sarkar deepayansarkar at yahoo.com
Wed Jan 9 22:14:51 CET 2002



There's a hack you can use if you are sure that you are going to produce 
only one plot (more precisely, if you are sure that the first plot on that 
device is going to be produced by lattice). Try


trellis.device("png", file="mygraph.png")

.lattice.print.more <<- TRUE

data(quakes)
xyplot(long ~ lat , data = quakes)
dev.off()

The same should work in other devices as well. 

Note that you should ALWAYS USE trellis.device() to start a device, and 
not just something like png(). 





--- Thomas Stockton <stockton at neptuneandco.com> wrote:
> 
> I'm having problems copying and saving lattice graphs using R-1.4.0 under
> Win2k. It seems I've see this alluded to recently in R-help.
> 
> If I do the following example:
> 
> > data(quakes)
> > xyplot(long ~ lat , data = quakes)
> 
> And then try to copy or save the graph as either a metafile or bitmap or if
> I use any of the bitmap/metafile devices via (for example)
> 
> > png(file="mygraph.png")
> > data(quakes)
> > xyplot(long ~ lat , data = quakes)
> > dev.off()
> 
> I get the following type of error:
> Error in grid.newpage() : A png file can store only one figure.
> 
> or for a metafile:
> 
> Error: A metafile can store only one figure.
> 
> This happens using R-1.4.0 installed using SetupR.exe and under R-1.4.0 I
> make myself.
> 
> Any help with this is much appreciated.
> 
> On another note. Is anyone working on an svg graphics for R. Myself and a
> co-worker have developed svg bubble plots with gis underlays in R and I'm
> wondering about the possibilities of a more generic svg graphic driver.
> 
> 
> Thanks!
> 
> Tom Stockton
> Neptune and Company
> stockton at neptuneandco.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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list