3D gray or color level plot of a surface
plot3d1(x,y,z,[theta,alpha,leg,flag,ebox])
plot3d1(xf,yf,zf,[theta,alpha,leg,flag,ebox])
plot3d1(x,y,z,<opts_args>)
plot3d1(xf,yf,zf,<opts_args>)
: :mode=0: a mesh of the surface is drawn. : :mode<0: the surface is painted with color “-mode” ; the boundary
of the facet is not drawn. Note that the surface color treatement can be done using color_mode and color_flag options through the surface entity properties (see surface_properties).
:
type=0: | the plot is made using the current 3D scaling (set by a previous call to param3d, plot3d, contour or plot3d1). |
---|
:
box=0: | nothing is drawn around the plot. |
---|
: :box=1: unimplemented (like box=0). : :box=2: only the axes behind the surface are drawn. : :box=3: a box surrounding the surface is drawn and captions are
added.
:
:
:
plot3d1 plots a surface with colors depending on the z-level of the surface. This special plot function can also be enabled setting color_flag=1 after a plot3d (see surface_properties)
Enter the command plot3d1() to see a demo.
// simple plot using z=f(x,y)
t=[0:0.3:2*%pi]'; z=`sin`_(t)*`cos`_(t');
plot3d1(t,t,z)
// same plot using facets computed by genfac3d
[xx,yy,zz]=`genfac3d`_(t,t,z);
`clf`_();
plot3d1(xx,yy,zz)
// multiple plots
`clf`_();
plot3d1([xx xx],[yy yy],[zz 4+zz])
// simple plot with viewpoint and captions
`clf`_() ;
plot3d1(1:10,1:20,10*`rand`_(10,20),35,45,"X@Y@Z",[2,2,3])
// same plot without grid
`clf`_()
plot3d1(1:10,1:20,10*`rand`_(10,20),35,45,"X@Y@Z",[-2,2,3])
// plot of a sphere using facets computed by eval3dp
`deff`_("[x,y,z]=sph(alp,tet)",["x=r*cos(alp).*cos(tet)+orig(1)*ones(tet)";..
"y=r*cos(alp).*sin(tet)+orig(2)*ones(tet)";..
"z=r*sin(alp)+orig(3)*ones(tet)"]);
r=1; orig=[0 0 0];
[xx,yy,zz]=`eval3dp`_(sph,`linspace`_(-%pi/2,%pi/2,40),`linspace`_(0,%pi*2,20));
`clf`_()
`plot3d`_(xx,yy,zz)
e=`gce`_();
e.color_flag=1;
`scf`_(2);
plot3d1(xx,yy,zz) // the 2 graphics are similar