Scilab Reference Manual |
---|
contour — level curves on a 3D surface
contour(x,y,z,nz,[theta,alpha,leg,flag,ebox,zlev]) contour(x,y,z,nz,<opt_args>)
x,y | : two real row vectors of size n1 and n2. | ||||||||||||||||||||||||||||||||||||
z | : real matrix of size (n1,n2), the values of the function. | ||||||||||||||||||||||||||||||||||||
nz | : the level values or the number of levels.
| ||||||||||||||||||||||||||||||||||||
<opt_args> | : a sequence of statements key1=value1, key2=value2, ... where keys may be theta,alpha,leg, flag, ebox,zlev (see below). In this case, the order has no special meaning. | ||||||||||||||||||||||||||||||||||||
theta, alpha | : real values giving in degree the spherical coordinates of the observation point. | ||||||||||||||||||||||||||||||||||||
leg | : string defining the captions for each axis with @ as a field separator, for example "X@Y@Z". | ||||||||||||||||||||||||||||||||||||
flag | : a real vector of size three flag=[mode,type,box].
| ||||||||||||||||||||||||||||||||||||
ebox | : used when type in flag is 1. It specifies the boundaries of the plot as the vector [xmin,xmax,ymin,ymax,zmin,zmax]. | ||||||||||||||||||||||||||||||||||||
zlev | : real number. |
contour draws level curves of a surface z=f(x,y). The level curves are drawn on a 3D surface. The optional arguments are the same as for the function plot3d (except zlev) and their meanings are the same. They control the drawing of level curves on a 3D plot. Only flag(1)=mode has a special meaning.
mode=0 | : the level curves are drawn on the surface defined by (x,y,z). |
mode=1 | : the level curves are drawn on a 3D plot and on the plan defined by the equation z=zlev. |
mode=2 | : the level curves are drawn on a 2D plot. |
You can change the format of the floating point number printed on the levels by using xset("fpf",string) where string gives the format in C format syntax (for example string="%.3f"). Use string="" to switch back to default format and Use string=" " to suppress printing.
Usually we use contour2d to draw levels curves on a 2D plot.
Enter the command contour() to see a demo.
t=%pi*[-10:10]/10; deff("[z]=surf(x,y)","z=sin(x)*cos(y)"); z=feval(t,t,surf); rect=[-%pi,%pi,-%pi,%pi,-1,1]; contour(t,t,z,10,35,45," ",[0,1,0],rect) // changing the format of the printing of the levels xset("fpf","%.2f") xbasc() contour(t,t,z,10,flag=[0,1,0],ebox=rect)
J.Ph.C.
<< contourf | copy >> |