u = %pi*(-1:0.2:1)/2; v = %pi/2*(-1:0.2:1); n = size(u,'*'); x= cos(u)'*exp(cos(v)); /// \sleftarrow{\normalfont a surface parameterized by \verb+u+,\verb+v+} y= cos(u)'*sin(v); z= sin(u)'*ones(v); col=ones(u)'*cos(v); /// \sleftarrow{\normalfont a color {for} each vertex } col=(n-1)*(col-min(col))/(max(col)-min(col))+1; /// \sleftarrow{\normalfont rescale colors } drawlater(); /// \sleftarrow{\normalfont draw later ! } [xx,yy,zz]=nf3d(x,y,z); /// \sleftarrow{\normalfont from \verb+(x,y,z)+ to four sided faces } [xx,yy,zzcol]=nf3d(x,y,col); /// \sleftarrow{\normalfont change the colors as well} xx=[xx,-xx];yy=[yy,-yy];zz=[zz,zz];zzcol=[zzcol,zzcol]; /// \sleftarrow{\normalfont symetry} a=gca(); /// \sleftarrow{\normalfont handler to the current axes } plot3d(xx,yy,list(zz,-zzcol)); /// \sleftarrow{\normalfont Let's do it } f=gcf(); /// \sleftarrow{\normalfont handler to the figure } f3d=a.children; /// \sleftarrow{\normalfont just one child, it's our 3d plot } f3d.hiddencolor=n;/// \sleftarrow{\normalfont set the hidden face's colors } a.rotation_angles = [55,110];/// \sleftarrow{\normalfont set the view angles } f.color_map= graycolormap(n);/// \sleftarrow{\normalfont set the colormap \index{colormap@\texttt{colormap}}} drawnow(); /// \sleftarrow{\normalfont show the result on graphic window } xs2ps(0,'plot3d') /// @@prerequisite unix(SCI+'/bin/Blatexpr 1 1 plot3d '); /// @@prerequisite