[R] how to draw manifold?

Carl Witthoft carl at witthoft.com
Sat Nov 20 17:29:48 CET 2010


Hi,
I need some help either in how to configure variables for wireframe(), 
or some suggestions as to other graphics commands to use for plotting a 
2-D manifold in 3-D space.

Here is an example I tried (in the hopes that it would plot a helical 
line) :

xsp<-matrix(c(cos(seq(0,80)/5)),9,9)
ysp<-matrix(c(sin(seq(0,80)/5)),9,9)
zsp<-matrix(c((seq(0,80)/20)),9,9)
wireframe(zsp~xsp*ysp)

The resulting plot looks vaguely like a helix, but not right.  And if I 
change my variables' dimensions to c(3,27) it looks "better," but if the 
dims are c(1,81), nothing gets plotted.

So: is there a way to control which points are connected by lines in 
wireframe()?  Or is there a more appropriate way to provide a plotting 
program with sets of coordinates in 3-space?

My primary goal is to be able to plot surfaces, not just a line as in my 
sample code.  For example, I might expand the data above to represent 
points on a 'ribbon' helix.

Thanks for yr. help -- feel free to point me to help files for existing 
packages or plotting routines.

Carl



More information about the R-help mailing list