Re: [R] 4D Plot ??

From: hadley wickham <h.wickham_at_gmail.com>
Date: Fri 08 Apr 2005 - 01:14:35 EST

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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Apr 08 01:21:36 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:03 EST