[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Simple 3-D plotting
From: |
Donald J Bindner |
Subject: |
Re: Simple 3-D plotting |
Date: |
Tue, 29 Aug 2006 08:30:26 -0500 |
User-agent: |
Mutt/1.5.9i |
On Sat, Aug 26, 2006 at 07:13:49AM -0700, Robert A. Macy wrote:
> Systems that don't have plot3?
On my Debian system, plot3() is part of the octave-forge package.
If you have just octave installed you won't have it. That's when
I use the mesh() function to draw my curves.
There can also be some practical advantage to mesh() I think,
because you can give thickness to your curves. For calculus
classes, I sometimes draw curves on surfaces, and to make sure
the curve shows from every orientation, I do something like
this (note line 5):
octave:1> t = linspace(0,1.5,21);
octave:2> x = cos(t).*t;
octave:3> y = sin(t).*t;
octave:4> z = t.*t;
octave:5> xx = [x;x]; yy = [y;y]; zz = [z-0.1;z+0.1];
octave:6> mesh(xx,yy,zz)
octave:7> t = linspace(0,2*pi,31);
octave:8> u = linspace(0,1.5,21);
octave:9> [tt,uu] = meshgrid(t,u);
octave:10> xx = uu.*cos(tt);
octave:11> yy = uu.*sin(tt);
octave:12> zz = uu.*tt;
octave:13> hold on
octave:14> mesh(xx,yy,zz)
The vertical height ensures that the curve shows above and below
a surface.
--
Don Bindner <address@hidden>