[R] Using contour3d: axes, plotting to file, with lattice

Duncan Murdoch murdoch at stats.uwo.ca
Thu Feb 11 22:36:21 CET 2010


On 11/02/2010 3:20 PM, Waichler, Scott R wrote:
> I am looking for examples of how to plot with contour3d() to a PNG or PDF file, add axes and other elements to the isosurface plot, and use contour3d in conjunction with lattice.  

You can't really combine rgl with lattice:  rgl uses a completely 
different graphics system.  (This might be wrong if lattice can import a 
bitmap, but that would be the only way to get rgl material into lattice.) 

To add axes and other stuff, read the rgl man pages.  There are 
functions axis3d, points3d, etc., that can add things to rgl plots. 

It's also possible in misc3d to output to static displays using either 
static or grid graphics; the latter would be combinable with lattice, 
but I've never used it.  I think it would be harder to add elements, 
since doing 3d graphics in a 2d system requires all sorts of ordering 
tricks, and you really need low level access.

To output rgl displays to PNG files, use rgl.snapshot.

Duncan Murdoch
> Regarding lattice, I'm not necessarily looking for conditioning on the data shown in the isosurface plots, just a way to show multiple plots in one figure and label them.  I am new to the packages misc3d and rgl.  
>
> Thanks,
> Scott Waichler
> Pacific Northwest National Laboratory
> scott.waichler at pnl.gov
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list