1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
4
<LANGUAGE>eng</LANGUAGE>
8
<TYPE>Scilab Function</TYPE>
10
<DATE>April 1993</DATE>
12
<SHORT_DESCRIPTION name="plot3d">3D plot of a surface</SHORT_DESCRIPTION>
15
<CALLING_SEQUENCE_ITEM>plot3d(x,y,z,[theta,alpha,leg,flag,ebox])</CALLING_SEQUENCE_ITEM>
17
<CALLING_SEQUENCE_ITEM>plot3d(x,y,z,<opt_args>)</CALLING_SEQUENCE_ITEM>
19
<CALLING_SEQUENCE_ITEM></CALLING_SEQUENCE_ITEM>
21
<CALLING_SEQUENCE_ITEM>plot3d(xf,yf,zf,[theta,alpha,leg,flag,ebox])</CALLING_SEQUENCE_ITEM>
23
<CALLING_SEQUENCE_ITEM>plot3d(xf,yf,zf,<opt_args>)</CALLING_SEQUENCE_ITEM>
25
<CALLING_SEQUENCE_ITEM></CALLING_SEQUENCE_ITEM>
27
<CALLING_SEQUENCE_ITEM>plot3d(xf,yf,list(zf,colors),[theta,alpha,leg,flag,ebox])</CALLING_SEQUENCE_ITEM>
29
<CALLING_SEQUENCE_ITEM>plot3d(xf,yf,list(zf,colors),<opt_args>)</CALLING_SEQUENCE_ITEM>
35
<PARAM_NAME>x,y</PARAM_NAME>
38
<SP>: row vectors of sizes n1 and n2 (x-axis and y-axis
39
coordinates). These coordinates must be monotone.</SP>
44
<PARAM_NAME>z</PARAM_NAME>
47
<SP>: matrix of size (n1,n2). <VERB>z(i,j)</VERB> is the value of
48
the surface at the point (x(i),y(j)).</SP>
53
<PARAM_NAME>xf,yf,zf</PARAM_NAME>
56
<SP>: matrices of size (nf,n). They define the facets used to draw
57
the surface. There are <VERB>n</VERB> facets. Each facet
58
<VERB>i</VERB> is defined by a polygon with <VERB>nf</VERB> points.
59
The x-axis, y-axis and z-axis coordinates of the points of the ith
60
facet are given respectively by <VERB>xf(:,i)</VERB>,
61
<VERB>yf(:,i)</VERB> and <VERB>zf(:,i)</VERB>.</SP>
66
<PARAM_NAME>colors</PARAM_NAME>
69
<SP>: a vector of size n giving the color of each facets or a matrix
70
of size (nf,n) giving color near each facet boundary (facet color is
76
<PARAM_NAME><opt_args></PARAM_NAME>
79
<SP>: This represents a sequence of statements <VERB>key1=value1,
80
key2=value2</VERB>,... where <VERB>key1</VERB>,
81
<VERB>key2,...</VERB> can be one of the following: theta, alpha
82
,leg,flag,ebox (see definition below).</SP>
87
<PARAM_NAME>theta, alpha</PARAM_NAME>
90
<SP>: real values giving in degree the spherical coordinates of the
91
observation point.</SP>
96
<PARAM_NAME>leg</PARAM_NAME>
99
<SP>: string defining the labels for each axis with @ as a field
100
separator, for example "X@Y@Z".</SP>
105
<PARAM_NAME>flag</PARAM_NAME>
108
<SP>: a real vector of size three.
109
<VERB>flag=[mode,type,box]</VERB>.</SP>
113
<PARAM_NAME>mode</PARAM_NAME>
116
<SP>: an integer (surface color).</SP>
120
<PARAM_NAME>mode>0</PARAM_NAME>
123
<SP>: the surface is painted with color
124
<VERB>"mode"</VERB> ; the boundary of the facet is drawn
125
with current line style and color.</SP>
130
<PARAM_NAME>mode=0: </PARAM_NAME>
133
<SP>a mesh of the surface is drawn.</SP>
138
<PARAM_NAME>mode<0: </PARAM_NAME>
141
<SP>the surface is painted with color
142
<VERB>"-mode"</VERB> ; the boundary of the facet is not
145
<P>Note that the surface color treatement can be done
146
using <VERB>color_mode</VERB> and
147
<VERB>color_flag</VERB> options through the surface
148
entity properties (see
149
<LINK>surface_properties</LINK>).</P>
157
<PARAM_NAME>type</PARAM_NAME>
160
<SP>: an integer (scaling).</SP>
164
<PARAM_NAME>type=0: </PARAM_NAME>
167
<SP>the plot is made using the current 3D scaling (set
168
by a previous call to <VERB>param3d</VERB>,
169
<VERB>plot3d</VERB>, <VERB>contour</VERB> or
170
<VERB>plot3d1</VERB>).</SP>
175
<PARAM_NAME>type=1: </PARAM_NAME>
178
<SP>rescales automatically 3d boxes with extreme aspect
179
ratios, the boundaries are specified by the value of the
180
optional argument <VERB>ebox</VERB>.</SP>
185
<PARAM_NAME>type=2: </PARAM_NAME>
188
<SP>rescales automatically 3d boxes with extreme aspect
189
ratios, the boundaries are computed using the given
195
<PARAM_NAME>type=3: </PARAM_NAME>
198
<SP>3d isometric with box bounds given by optional
199
<VERB>ebox</VERB>, similarily to
200
<VERB>type=1</VERB>.</SP>
205
<PARAM_NAME>type=4: </PARAM_NAME>
208
<SP>3d isometric bounds derived from the data, to
209
similarily<VERB>type=2</VERB>.</SP>
214
<PARAM_NAME>type=5: </PARAM_NAME>
217
<SP>3d expanded isometric bounds with box bounds given
218
by optional <VERB>ebox</VERB>, similarily to
219
<VERB>type=1</VERB>.</SP>
224
<PARAM_NAME>type=6: </PARAM_NAME>
227
<SP>3d expanded isometric bounds derived from the data,
228
similarily to <VERB>type=2</VERB>.</SP>
230
<P>Note that axes boundaries can be customized through
231
the axes entity properties (see
232
<LINK>axes_properties</LINK>).</P>
240
<PARAM_NAME>box</PARAM_NAME>
243
<SP>: an integer (frame around the plot).</SP>
247
<PARAM_NAME>box=0: </PARAM_NAME>
250
<SP>nothing is drawn around the plot.</SP>
255
<PARAM_NAME>box=1: </PARAM_NAME>
258
<SP>unimplemented (like box=0).</SP>
263
<PARAM_NAME>box=2: </PARAM_NAME>
266
<SP>only the axes behind the surface are drawn.</SP>
271
<PARAM_NAME>box=3: </PARAM_NAME>
274
<SP>a box surrounding the surface is drawn and captions
280
<PARAM_NAME>box=4: </PARAM_NAME>
283
<SP>a box surrounding the surface is drawn, captions and
286
<P>Note that axes aspect can also be customized through
287
the axes entity properties (see
288
<LINK>axes_properties</LINK>).</P>
299
<PARAM_NAME>ebox</PARAM_NAME>
302
<SP>: It specifies the boundaries of the plot as the vector
303
<VERB>[xmin,xmax,ymin,ymax,zmin,zmax]</VERB>. This argument is used
304
together with <VERB>type</VERB> in <VERB>flag</VERB> : if it is set
305
to <VERB>1</VERB>, <VERB>3</VERB> or <VERB>5</VERB> (see above to
306
see the corresponding behaviour). If <VERB>flag</VERB> is missing,
307
<VERB>ebox</VERB> is not taken into acoount.</SP>
309
<P> Note that, when specified, the <VERB>ebox</VERB> argument acts
310
on the <VERB>data_bounds</VERB> field that can also be reset through
311
the axes entity properties (see <LINK>axes_properties</LINK>).</P>
318
<P><VERB>plot3d(x,y,z,[theta,alpha,leg,flag,ebox])</VERB> draws the
319
parametric surface <VERB>z=f(x,y)</VERB>.</P>
321
<P><VERB>plot3d(xf,yf,zf,[theta,alpha,leg ,flag,ebox])</VERB> draws a
322
surface defined by a set of facets. You can draw multiple plots by
323
replacing <VERB>xf</VERB>, <VERB>yf</VERB> and <VERB>zf</VERB> by multiple
324
matrices assembled by rows as <VERB>[xf1 xf2 ...]</VERB>, <VERB>[yf1 yf2
325
...]</VERB> and <VERB>[zf1 zf2 ...]</VERB>. Note that data can also be set
326
or get through the surface entity properties (see
327
<LINK>surface_properties</LINK>).</P>
331
<P>You can give a specific color for each facet by using
332
<VERB>list(zf,colors)</VERB> instead of <VERB>zf</VERB>, where
333
<VERB>colors</VERB> is a vector of size <VERB>n</VERB>. If
334
<VERB>colors(i)</VERB> is positive it gives the color of facet
335
<VERB>i</VERB> and the boundary of the facet is drawn with current line
336
style and color. If <VERB>colors(i)</VERB> is negative, color id
337
<VERB>-colors(i)</VERB> is used and the boundary of the facet is not
342
<P>It is also possible to get interpolated color for facets. For that the
343
color argument must be a matrix of size nfxn giving the color near each
344
boundary of each facets. In this case positive values for colors mean that
345
the boundary are not drawn. Note that colors can also be set through the
346
surface entity properties (via <VERB>tlist</VERB> affectations) and edited
347
using <VERB>color_flag</VERB> option (see
348
<LINK>surface_properties</LINK>).</P>
352
<P>The optional arguments <VERB>theta, alpha, leg ,flag, ebox</VERB>, can
353
be passed by a sequence of statements <VERB>key1=value1,
354
key2=value2</VERB>, ... In this case, the order has no special meaning.
355
Note that all these optional arguments except <VERB>flag</VERB> can be
356
customized through the axes entity properties (see
357
<LINK>axes_properties</LINK>). As described before, the <VERB>flag</VERB>
358
option deals with surface entity properties for <VERB>mode</VERB> (see
359
<LINK>surface_properties</LINK>) and axes properties for <VERB>type</VERB>
360
and <VERB>box</VERB> (see <LINK>axes_properties</LINK>).</P>
364
<P>You can use the function <VERB>genfac3d</VERB> to compute four sided
365
facets from the surface <VERB>z=f(x,y)</VERB>. <VERB>eval3dp</VERB> can
370
<P>Enter the command <VERB>plot3d()</VERB> to see a demo.</P>
373
<SECTION label="More information">
374
<P>To get more information on the plot3d old syntax , use the
375
<LINK>plot3d_old_version</LINK> help document.</P>
378
<EXAMPLE><![CDATA[// simple plot using z=f(x,y) t=[0:0.3:2*%pi]'; z=sin(t)*cos(t'); plot3d(t,t,z) // same plot using facets computed by genfac3d [xx,yy,zz]=genfac3d(t,t,z); clf() plot3d(xx,yy,zz) // multiple plots clf() plot3d([xx xx],[yy yy],[zz 4+zz]) // multiple plots using colors clf() plot3d([xx xx],[yy yy],list([zz zz+4],[4*ones(1,400) 5*ones(1,400)])) // simple plot with viewpoint and captions clf() plot3d(1:10,1:20,10*rand(10,20),alpha=35,theta=45,flag=[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) clf(); f=gcf(); f.color_map = hotcolormap(128); r=0.3;orig=[1.5 0 0]; [xx1,yy1,zz1]=eval3dp(sph,linspace(-%pi/2,%pi/2,40),linspace(0,%pi*2,20)); cc=(xx+zz+2)*32;cc1=(xx1-orig(1)+zz1/r+2)*32; clf();plot3d1([xx xx1],[yy yy1],list([zz,zz1],[cc cc1]),theta=70,alpha=80,flag=[5,6,3]) //Available operations using only New Graphics... delete(gcf()); t=[0:0.3:2*%pi]'; z=sin(t)*cos(t'); [xx,yy,zz]=genfac3d(t,t,z); plot3d([xx xx],[yy yy],list([zz zz+4],[4*ones(1,400) 5*ones(1,400)])) e=gce(); f=e.data; TL = tlist(["3d" "x" "y" "z" "color"],f.x,f.y,f.z,6*rand(f.z)); // random color matrix e.data = TL; TL2 = tlist(["3d" "x" "y" "z" "color"],f.x,f.y,f.z,4*rand(1,800)); // random color vector e.data = TL2; TL3 = tlist(["3d" "x" "y" "z" "color"],f.x,f.y,f.z,[20*ones(1,400) 6*ones(1,400)]); e.data = TL3; TL4 = tlist(["3d" "x" "y" "z"],f.x,f.y,f.z); // no color e.data = TL4; e.color_flag=1 // color index proportional to altitude (z coord.) e.color_flag=2; // back to default mode e.color_flag= 3; // interpolated shading mode (based on blue default color) clf() plot3d([xx xx],[yy yy],list([zz zz+4],[4*ones(1,400) 5*ones(1,400)])) h=gce(); //get handle on current entity (here the surface) a=gca(); //get current axes a.rotation_angles=[40,70]; a.grid=[1 1 1]; //make grids a.data_bounds=[-6,6;6,-1;0,5]; a.axes_visible="off"; //axes are hidden a.axes_bounds=[.2 0 1 1]; h.color_flag=1; //color according to z h.color_mode=-2; //remove the facets boundary by setting color_mode to white color h.color_flag=2; //color according to given colors h.color_mode = -1; // put the facets boundary back by setting color_mode to black color f=gcf();//get the handle of the parent figure f.color_map=hotcolormap(512); c=[1:400,1:400]; TL.color = [c;c+1;c+2;c+3]; h.data = TL; h.color_flag=3; // interpolated shading mode]]></EXAMPLE>
386
<LINK>genfac3d</LINK>
422
<AUTHOR>J.Ph.C.</AUTHOR>
b'\\ No newline at end of file'