[R] 4D Plot ??

hadley wickham h.wickham at gmail.com
Thu Apr 7 17:14:35 CEST 2005


Hi Mike,

I've done a bit of playing around with these kind of plots for
visualising microarray data (to eventually go into a bioconductor
package).  I've attached my code for producing surfaceplots (my  name
for the type of plots that includes both image and contour plots) -
it's all lattice based, so you'll need some familiarity with how
lattice works to understand how it all works.

The key function is panel.superpose.surface which you can use as follows:

levelplot(surfacevar + contourvar ~ x * y, data,
panel=panel.surface.smooth, asp="iso")

(note that the contours are automatically smoothed using image.smooth
from the fields package - you can control the amount of smoothing use
contour.theta)

You can supply multiple contour variables, but be advised it gets
messy really quickly!  You can also smooth the surface by setting
panel.base = panel.surface.smooth

Hope this is helpful!

Hadley
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: surfaceplot-ma.R
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20050407/a6a230f1/surfaceplot-ma.pl


More information about the R-help mailing list