13
13
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" version="5.0-subset Scilab" xml:lang="en" xml:id="Graphics">
15
<refname>Graphics: Getting started</refname>
16
<refpurpose> graphics library overview</refpurpose>
19
<title>2d plotting</title>
23
<link linkend="plot2d">plot2d</link>
26
<para>Plot a curve</para>
28
<emphasis role="bold">Example:</emphasis>
31
<scilab:image>plot2d();</scilab:image>
37
<link linkend="plot2d2">plot2d2</link>
40
<para>Plot a curve as step function</para>
42
<emphasis role="bold">Example:</emphasis>
45
<scilab:image>plot2d2();</scilab:image>
51
<link linkend="plot2d3">plot2d3</link>
54
<para>Plot a curve with vertical bars</para>
56
<emphasis role="bold">Example:</emphasis>
59
<scilab:image>plot2d3();</scilab:image>
65
<link linkend="plot2d4">plot2d4</link>
68
<para>Plot a curve with arrows</para>
70
<emphasis role="bold">Example:</emphasis>
73
<scilab:image>plot2d4();</scilab:image>
79
<link linkend="fplot2d">fplot2d</link>
82
<para>Plot a curve defined by a function</para>
84
<emphasis role="bold">Example:</emphasis>
87
<scilab:image>fplot2d();</scilab:image>
93
<link linkend="champ">champ</link>
96
<para>2D vector field</para>
98
<emphasis role="bold">Example:</emphasis>
101
<scilab:image>champ();</scilab:image>
107
<link linkend="champ1">champ1</link>
110
<para>2D vector field with colored arrows</para>
112
<emphasis role="bold">Example:</emphasis>
115
<scilab:image>champ1();</scilab:image>
121
<link linkend="fchamp">fchamp</link>
124
<para>Direction field of a 2D first order ODE</para>
126
<emphasis role="bold">Example:</emphasis>
129
<scilab:image>fchamp();</scilab:image>
135
<link linkend="contour2d">contour2d</link>
138
<para>Level curves of a surface on a 2D plot</para>
143
<link linkend="fcontour2d">fcontour2d</link>
146
<para>Level curves of a surface defined by a function on a 2D plot</para>
148
<emphasis role="bold">Example:</emphasis>
151
<scilab:image>fcontour2d();</scilab:image>
157
<link linkend="grayplot">grayplot</link>
160
<para>2D plot of a surface using colors</para>
162
<emphasis role="bold">Example:</emphasis>
165
<scilab:image>grayplot();</scilab:image>
171
<link linkend="fgrayplot">fgrayplot</link>
174
<para>2D plot of a surface defined by a function using colors</para>
176
<emphasis role="bold">Example:</emphasis>
179
<scilab:image>fgrayplot();</scilab:image>
185
<link linkend="Sgrayplot">Sgrayplot</link>
188
<para>Smooth 2D plot of a surface using colors</para>
190
<emphasis role="bold">Example:</emphasis>
193
<scilab:image>Sgrayplot();</scilab:image>
199
<link linkend="Sfgrayplot">Sfgrayplot</link>
202
<para>Smooth 2D plot of a surface defined by a function using colors</para>
204
<emphasis role="bold">Example:</emphasis>
207
<scilab:image>Sfgrayplot();</scilab:image>
213
<link linkend="xgrid">xgrid</link>
216
<para>Add a grid on a 2D plot</para>
218
<emphasis role="bold">Example:</emphasis>
221
<scilab:image>xgrid();</scilab:image>
227
<link linkend="errbar">errbar</link>
230
<para>Add vertical error bars on a 2D plot</para>
232
<emphasis role="bold">Example:</emphasis>
235
<scilab:image>errbar();</scilab:image>
241
<link linkend="histplot">histplot</link>
244
<para>Plot a histogram</para>
246
<emphasis role="bold">Example:</emphasis>
249
<scilab:image>histplot();</scilab:image>
255
<link linkend="Matplot">Matplot</link>
258
<para>2D plot of a matrix using colors</para>
260
<emphasis role="bold">Example:</emphasis>
263
<scilab:image>Matplot();</scilab:image>
270
<title>3d plotting</title>
274
<link linkend="plot3d">plot3d</link>
277
<para>Plot a surface</para>
279
<emphasis role="bold">Example:</emphasis>
282
<scilab:image>plot3d();</scilab:image>
288
<link linkend="plot3d1">plot3d1</link>
291
<para>Plot a surface with gray or color level</para>
293
<emphasis role="bold">Example:</emphasis>
296
<scilab:image>plot3d1();</scilab:image>
302
<link linkend="fplot3d">fplot3d</link>
305
<para>Plot a surface defined by a function</para>
307
<emphasis role="bold">Example:</emphasis>
310
<scilab:image>fplot3d();</scilab:image>
316
<link linkend="fplot3d1">fplot3d1</link>
319
<para>Plot a surface defined by a function with gray or color level</para>
321
<emphasis role="bold">Example:</emphasis>
324
<scilab:image>fplot3d1();</scilab:image>
330
<link linkend="param3d">param3d</link>
333
<para>Plot one curve</para>
335
<emphasis role="bold">Example:</emphasis>
338
<scilab:image>param3d();</scilab:image>
344
<link linkend="param3d1">param3d1</link>
347
<para>Plots curves</para>
349
<emphasis role="bold">Example:</emphasis>
352
<scilab:image>param3d1();</scilab:image>
358
<link linkend="contour">contour</link>
361
<para>Level curves on a 3D surface</para>
363
<emphasis role="bold">Example:</emphasis>
366
<scilab:image>contour();</scilab:image>
372
<link linkend="fcontour">fcontour</link>
375
<para>Level curves on a 3D surface defined by a function</para>
377
<emphasis role="bold">Example:</emphasis>
380
<scilab:image>fcontour();</scilab:image>
386
<link linkend="hist3d">hist3d</link>
389
<para>3D representation of a histogram</para>
391
<emphasis role="bold">Example:</emphasis>
394
<scilab:image>hist3d();</scilab:image>
400
<link linkend="genfac3d">genfac3d</link>
403
<para>Compute facets of a 3D surface</para>
405
<emphasis role="bold">Example:</emphasis>
408
<scilab:image>genfac3d();</scilab:image>
414
<link linkend="eval3dp">eval3dp</link>
417
<para>Compute facets of a 3D surface</para>
419
<emphasis role="bold">Example:</emphasis>
422
<scilab:image>p1=linspace(0,2*%pi,10);
423
p2=linspace(0,2*%pi,10);
424
deff("[x,y,z]=scp(p1,p2)",["x=p1.*sin(p1).*cos(p2)";..
425
"y=p1.*cos(p1).*cos(p2)";..
427
[Xf,Yf,Zf]=eval3dp(scp,p1,p2);
435
<link linkend="geom3d">geom3d</link>
438
<para>Projection from 3D on 2D after a 3D plot</para>
440
<emphasis role="bold">Example:</emphasis>
443
<scilab:image>deff("[z]=surface(x,y)","z=sin(x)*cos(y)")
445
// 3D plot of the surface
446
fplot3d(t,t,surface,35,45,"X@Y@Z")
447
// now (t,t,sin(t).*cos(t)) is a curve on the surface
448
// which can be drawn using geom3d and xpoly
449
[x,y]=geom3d(%pi/2,0,surface(%pi/2,0))
457
<title>Line and polygon plotting</title>
461
<link linkend="xpoly">xpoly</link>
464
<para>Draw a polyline or a polygon</para>
469
<link linkend="xpolys">xpolys</link>
472
<para>Draw a set of polylines or polygons</para>
477
<link linkend="xrpoly">xrpoly</link>
480
<para>Draw a regular polygon</para>
485
<link linkend="xsegs">xsegs</link>
488
<para>Draw unconnected segments</para>
493
<link linkend="xfpoly">xfpoly</link>
496
<para>Fill a polygon</para>
501
<link linkend="xfpolys">xfpolys</link>
504
<para>Fill a set of polygons</para>
510
<title>Rectangle plotting</title>
514
<link linkend="xrect">xrect</link>
517
<para>Draw a rectangle</para>
522
<link linkend="xfrect">xfrect</link>
525
<para>Fill a rectangle</para>
530
<link linkend="xrects">xrects</link>
533
<para>Draw or fill a set of rectangles</para>
539
<title>Arc plotting</title>
543
<link linkend="xarc">xarc</link>
546
<para>Draw a part of an ellipse</para>
551
<link linkend="xarcs">xarcs</link>
554
<para>Draw parts of a set of ellipses</para>
559
<link linkend="xfarc">xfarc</link>
562
<para>Fill a part of an ellipse</para>
567
<link linkend="xfarcs">xfarcs</link>
570
<para>Fill parts of a set of ellipses</para>
576
<title>Arrow plotting</title>
580
<link linkend="xarrows">xarrows</link>
583
<para>Draw a set of arrows</para>
589
<title>Strings</title>
593
<link linkend="xstring">xstring</link>
596
<para>Draw strings</para>
601
<link linkend="xstringl">xstringl</link>
604
<para>Compute a box which surrounds strings</para>
609
<link linkend="xstringb">xstringb</link>
612
<para>Draw strings into a box</para>
614
<emphasis role="bold">Example:</emphasis>
617
<scilab:image>xstringb();</scilab:image>
623
<link linkend="xtitle">xtitle</link>
626
<para>Add titles on a graphics window</para>
628
<emphasis role="bold">Example:</emphasis>
631
<scilab:image>xtitle();</scilab:image>
637
<link linkend="titlepage">titlepage</link>
640
<para>Add a title in the middle of a graphics window</para>
645
<link linkend="xinfo">xinfo</link>
648
<para>Draw an info string in the message subwindow</para>
654
<title>Frames and axes</title>
658
<link linkend="drawaxis">drawaxis</link>
661
<para>Draw an axis</para>
666
<link linkend="graduate">graduate</link>
669
<para>Pretty axis graduations</para>
674
<link linkend="plotframe">plotframe</link>
677
<para>Plot a frame with scaling and grids</para>
683
<title>Coordinates transformations</title>
687
<link linkend="isoview">isoview</link>
690
<para>Set scales for isometric plot (do not change the size of the window)</para>
695
<link linkend="square">square</link>
698
<para>Set scales for isometric plot (change the size of the window)</para>
703
<link linkend="scaling">scaling</link>
706
<para>Affine transformation of a set of points</para>
711
<link linkend="rotate">rotate</link>
714
<para>Rotation of a set of points</para>
719
<link linkend="xsetech">xsetech</link>
722
<para>Set the sub-window of a graphics window for plotting</para>
727
<link linkend="subplot">subplot</link>
730
<para>Divide a graphics window into a matrix of sub-windows</para>
735
<link linkend="xgetech">xgetech</link>
738
<para>Get the current graphics scale</para>
743
<link linkend="xchange">xchange</link>
746
<para>Transform real to pixel coordinates</para>
752
<title>Colors</title>
756
<link linkend="colormap">colormap</link>
759
<para>Using colormaps</para>
764
<link linkend="getcolor">getcolor</link>
767
<para>Dialog to select colors in the current colormap</para>
772
<link linkend="addcolor">addcolor</link>
775
<para>Add new colors to the current colormap</para>
780
<link linkend="graycolormap">graycolormap</link>
783
<para>Linear gray colormap</para>
788
<link linkend="hotcolormap">hotcolormap</link>
791
<para>Red to yellow colormap</para>
797
<title>Graphics context</title>
801
<link linkend="xset">xset</link>
804
<para>Set values of the graphics context</para>
809
<link linkend="xget">xget</link>
812
<para>Get current values of the graphics context</para>
817
<link linkend="xlfont">xlfont</link>
820
<para>Load a font in the graphics context or query loaded font</para>
825
<link linkend="getsymbol">getsymbol</link>
828
<para>Dialog to select a symbol and its size</para>
834
<title>Save and load</title>
838
<link linkend="xsave">xsave</link>
841
<para>Save graphics into a file</para>
846
<link linkend="xload">xload</link>
849
<para>Load a saved graphics</para>
854
<link linkend="xs2bmp">xs2bmp</link>
857
<para>Export graphics using the BMP format</para>
862
<link linkend="xs2emf">xs2emf</link>
865
<para>Export graphics using the EMF format</para>
870
<link linkend="xs2eps">xs2eps</link>
873
<para>Export graphics using the EPS format</para>
878
<link linkend="xs2gif">xs2gif</link>
881
<para>Export graphics using the GIF format</para>
886
<link linkend="xs2jpg">xs2jpg</link>
889
<para>Export graphics using the JPG format</para>
894
<link linkend="xs2pdf">xs2pdf</link>
897
<para>Export graphics using the PDF format</para>
902
<link linkend="xs2png">xs2png</link>
905
<para>Export graphics using the PNG format</para>
910
<link linkend="xs2ppm">xs2ppm</link>
913
<para>Export graphics using the PPM format</para>
918
<link linkend="xs2ps">xs2ps</link>
921
<para>Export graphics using the PS format</para>
926
<link linkend="xs2svg">xs2svg</link>
929
<para>Export graphics using the SVG format</para>
935
<title>Graphics primitives</title>
939
<link linkend="clf">clf</link>
942
<para>Clear a graphics window and erase the associated recorded graphics</para>
947
<link linkend="xclear">xclear</link>
950
<para>Clear a graphics window</para>
955
<link linkend="driver">driver</link>
958
<para>Select a graphics driver</para>
963
<link linkend="xinit">xinit</link>
966
<para>Initialisation of a graphics driver</para>
971
<link linkend="xend">xend</link>
974
<para>Close a graphics session</para>
979
<link linkend="xbasr">xbasr</link>
982
<para>Redraw a graphics window</para>
987
<link linkend="replot">replot</link>
990
<para>Redraw the current graphics window with new boundaries</para>
995
<link linkend="xpause">xpause</link>
998
<para>Suspend Scilab</para>
1003
<link linkend="show_window">show_window</link>
1006
<para>Raise the current graphics window</para>
1011
<link linkend="xdel">xdel</link>
1014
<para>Delete a graphics window</para>
1019
<link linkend="winsid">winsid</link>
1022
<para>Return the list of graphics windows</para>
1027
<link linkend="xname">xname</link>
1030
<para>Change the name of the current graphics window</para>
1036
<title>Mouse position</title>
1040
<link linkend="xclick">xclick</link>
1043
<para>Wait for a mouse click</para>
1048
<link linkend="locate">locate</link>
1051
<para>Mouse selection of a set of points</para>
1056
<link linkend="xgetmouse">xgetmouse</link>
1059
<para>Get the current position of the mouse</para>
1065
<title>Interactive editor</title>
1069
<link linkend="edit_curv">edit_curv</link>
1072
<para>Interactive graphics curve editor</para>
1078
<title>Graphics functions for automatic control</title>
1082
<link linkend="bode">bode</link>
1085
<para>Bode plot</para>
1087
<emphasis role="bold">Example:</emphasis>
1090
<scilab:image>s=poly(0,'s')
1091
h=syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01))
1092
clf();bode(h,0.01,100);
1099
<link linkend="gainplot">gainplot</link>
1102
<para>Magnitude plot</para>
1104
<emphasis role="bold">Example:</emphasis>
1107
<scilab:image>s=poly(0,'s')
1108
h1=syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01))
1109
h2=syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
1110
clf();gainplot([h1;h2],0.01,100,['h1';'h2'])
1118
<link linkend="nyquist">nyquist</link>
1121
<para>Nyquist plot</para>
1123
<emphasis role="bold">Example:</emphasis>
1126
<scilab:image>s=poly(0,'s')
1127
h=syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01));
1128
h1=h*syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
1131
h_h=ax.children($).children(2);
1132
tip=datatipCreate(h_h,[1.331,0.684]);
1133
datatipSetOrientation(tip,"upper left");
1140
<link linkend="m_circle">m_circle</link>
1143
<para>M-circle plot</para>
1145
<emphasis role="bold">Example:</emphasis>
1148
<scilab:image>m_circle();</scilab:image>
1154
<link linkend="chart">chart</link>
1157
<para>Nichols chart</para>
1159
<emphasis role="bold">Example:</emphasis>
1162
<scilab:image>chart();</scilab:image>
1168
<link linkend="black">black</link>
1171
<para>Black's diagram</para>
1173
<emphasis role="bold">Example:</emphasis>
1176
<scilab:image>s=poly(0,'s');
1177
sl=syslin('c',5*(1+s)/(.1*s^4+s^3+15*s^2+3*s+1))
1178
clf();black(sl,0.01,10);
1185
<link linkend="evans">evans</link>
1188
<para>Evans root locus</para>
1190
<emphasis role="bold">Example:</emphasis>
1193
<scilab:image>evans();</scilab:image>
1199
<link linkend="sgrid">sgrid</link>
1202
<para>s-plane grid lines</para>
1204
<emphasis role="bold">Example:</emphasis>
1207
<scilab:image>sgrid();</scilab:image>
1213
<link linkend="plzr">plzr</link>
1216
<para>pole-zero plot</para>
1218
<emphasis role="bold">Example:</emphasis>
1221
<scilab:image>s=poly(0,'s');
1222
n=[1+s 2+3*s+4*s^2 5; 0 1-s s];
1223
d=[1+3*s 5-s^3 s+1;1+s 1+s+s^2 3*s-1];
1232
<link linkend="zgrid">zgrid</link>
1235
<para>zgrid plot</para>
1237
<emphasis role="bold">Example:</emphasis>
1240
<scilab:image>zgrid();</scilab:image>
15
<refname>Graphics: Getting started</refname>
16
<refpurpose> graphics library overview</refpurpose>
19
<title>2d plotting</title>
23
<link linkend="plot2d">plot2d</link>
26
<para>Plot a curve</para>
28
<emphasis role="bold">Example:</emphasis>
31
<scilab:image>plot2d();</scilab:image>
37
<link linkend="plot2d2">plot2d2</link>
40
<para>Plot a curve as step function</para>
42
<emphasis role="bold">Example:</emphasis>
45
<scilab:image>plot2d2();</scilab:image>
51
<link linkend="plot2d3">plot2d3</link>
54
<para>Plot a curve with vertical bars</para>
56
<emphasis role="bold">Example:</emphasis>
59
<scilab:image>plot2d3();</scilab:image>
65
<link linkend="plot2d4">plot2d4</link>
68
<para>Plot a curve with arrows</para>
70
<emphasis role="bold">Example:</emphasis>
73
<scilab:image>plot2d4();</scilab:image>
79
<link linkend="fplot2d">fplot2d</link>
82
<para>Plot a curve defined by a function</para>
84
<emphasis role="bold">Example:</emphasis>
87
<scilab:image>fplot2d();</scilab:image>
93
<link linkend="champ">champ</link>
96
<para>2D vector field</para>
98
<emphasis role="bold">Example:</emphasis>
101
<scilab:image>champ();</scilab:image>
107
<link linkend="champ1">champ1</link>
110
<para>2D vector field with colored arrows</para>
112
<emphasis role="bold">Example:</emphasis>
115
<scilab:image>champ1();</scilab:image>
121
<link linkend="fchamp">fchamp</link>
124
<para>Direction field of a 2D first order ODE</para>
126
<emphasis role="bold">Example:</emphasis>
129
<scilab:image>fchamp();</scilab:image>
135
<link linkend="contour2d">contour2d</link>
138
<para>Level curves of a surface on a 2D plot</para>
143
<link linkend="fcontour2d">fcontour2d</link>
146
<para>Level curves of a surface defined by a function on a 2D plot</para>
148
<emphasis role="bold">Example:</emphasis>
151
<scilab:image>fcontour2d();</scilab:image>
157
<link linkend="grayplot">grayplot</link>
160
<para>2D plot of a surface using colors</para>
162
<emphasis role="bold">Example:</emphasis>
165
<scilab:image>grayplot();</scilab:image>
171
<link linkend="fgrayplot">fgrayplot</link>
174
<para>2D plot of a surface defined by a function using colors</para>
176
<emphasis role="bold">Example:</emphasis>
179
<scilab:image>fgrayplot();</scilab:image>
185
<link linkend="Sgrayplot">Sgrayplot</link>
188
<para>Smooth 2D plot of a surface using colors</para>
190
<emphasis role="bold">Example:</emphasis>
193
<scilab:image>Sgrayplot();</scilab:image>
199
<link linkend="Sfgrayplot">Sfgrayplot</link>
202
<para>Smooth 2D plot of a surface defined by a function using colors</para>
204
<emphasis role="bold">Example:</emphasis>
207
<scilab:image>Sfgrayplot();</scilab:image>
213
<link linkend="xgrid">xgrid</link>
216
<para>Add a grid on a 2D plot</para>
218
<emphasis role="bold">Example:</emphasis>
221
<scilab:image>xgrid();</scilab:image>
227
<link linkend="errbar">errbar</link>
230
<para>Add vertical error bars on a 2D plot</para>
232
<emphasis role="bold">Example:</emphasis>
235
<scilab:image>errbar();</scilab:image>
241
<link linkend="histplot">histplot</link>
244
<para>Plot a histogram</para>
246
<emphasis role="bold">Example:</emphasis>
249
<scilab:image>histplot();</scilab:image>
255
<link linkend="Matplot">Matplot</link>
258
<para>2D plot of a matrix using colors</para>
260
<emphasis role="bold">Example:</emphasis>
263
<scilab:image>Matplot();</scilab:image>
270
<title>3d plotting</title>
274
<link linkend="plot3d">plot3d</link>
277
<para>Plot a surface</para>
279
<emphasis role="bold">Example:</emphasis>
282
<scilab:image>plot3d();</scilab:image>
288
<link linkend="plot3d1">plot3d1</link>
291
<para>Plot a surface with gray or color level</para>
293
<emphasis role="bold">Example:</emphasis>
296
<scilab:image>plot3d1();</scilab:image>
302
<link linkend="fplot3d">fplot3d</link>
305
<para>Plot a surface defined by a function</para>
307
<emphasis role="bold">Example:</emphasis>
310
<scilab:image>fplot3d();</scilab:image>
316
<link linkend="fplot3d1">fplot3d1</link>
319
<para>Plot a surface defined by a function with gray or color level</para>
321
<emphasis role="bold">Example:</emphasis>
324
<scilab:image>fplot3d1();</scilab:image>
330
<link linkend="param3d">param3d</link>
333
<para>Plot one curve</para>
335
<emphasis role="bold">Example:</emphasis>
338
<scilab:image>param3d();</scilab:image>
344
<link linkend="param3d1">param3d1</link>
347
<para>Plots curves</para>
349
<emphasis role="bold">Example:</emphasis>
352
<scilab:image>param3d1();</scilab:image>
358
<link linkend="contour">contour</link>
361
<para>Level curves on a 3D surface</para>
363
<emphasis role="bold">Example:</emphasis>
366
<scilab:image>contour();</scilab:image>
372
<link linkend="fcontour">fcontour</link>
375
<para>Level curves on a 3D surface defined by a function</para>
377
<emphasis role="bold">Example:</emphasis>
380
<scilab:image>fcontour();</scilab:image>
386
<link linkend="hist3d">hist3d</link>
389
<para>3D representation of a histogram</para>
391
<emphasis role="bold">Example:</emphasis>
394
<scilab:image>hist3d();</scilab:image>
400
<link linkend="genfac3d">genfac3d</link>
403
<para>Compute facets of a 3D surface</para>
405
<emphasis role="bold">Example:</emphasis>
408
<scilab:image>genfac3d();</scilab:image>
414
<link linkend="eval3dp">eval3dp</link>
417
<para>Compute facets of a 3D surface</para>
419
<emphasis role="bold">Example:</emphasis>
422
<scilab:image>p1=linspace(0,2*%pi,10);
423
p2=linspace(0,2*%pi,10);
424
deff("[x,y,z]=scp(p1,p2)",["x=p1.*sin(p1).*cos(p2)";..
425
"y=p1.*cos(p1).*cos(p2)";..
427
[Xf,Yf,Zf]=eval3dp(scp,p1,p2);
435
<link linkend="geom3d">geom3d</link>
438
<para>Projection from 3D on 2D after a 3D plot</para>
440
<emphasis role="bold">Example:</emphasis>
443
<scilab:image>deff("[z]=surface(x,y)","z=sin(x)*cos(y)")
445
// 3D plot of the surface
446
fplot3d(t,t,surface,35,45,"X@Y@Z")
447
// now (t,t,sin(t).*cos(t)) is a curve on the surface
448
// which can be drawn using geom3d and xpoly
449
[x,y]=geom3d(%pi/2,0,surface(%pi/2,0))
457
<title>Line and polygon plotting</title>
461
<link linkend="xpoly">xpoly</link>
464
<para>Draw a polyline or a polygon</para>
469
<link linkend="xpolys">xpolys</link>
472
<para>Draw a set of polylines or polygons</para>
477
<link linkend="xrpoly">xrpoly</link>
480
<para>Draw a regular polygon</para>
485
<link linkend="xsegs">xsegs</link>
488
<para>Draw unconnected segments</para>
493
<link linkend="xfpoly">xfpoly</link>
496
<para>Fill a polygon</para>
501
<link linkend="xfpolys">xfpolys</link>
504
<para>Fill a set of polygons</para>
510
<title>Rectangle plotting</title>
514
<link linkend="xrect">xrect</link>
517
<para>Draw a rectangle</para>
522
<link linkend="xfrect">xfrect</link>
525
<para>Fill a rectangle</para>
530
<link linkend="xrects">xrects</link>
533
<para>Draw or fill a set of rectangles</para>
539
<title>Arc plotting</title>
543
<link linkend="xarc">xarc</link>
546
<para>Draw a part of an ellipse</para>
551
<link linkend="xarcs">xarcs</link>
554
<para>Draw parts of a set of ellipses</para>
559
<link linkend="xfarc">xfarc</link>
562
<para>Fill a part of an ellipse</para>
567
<link linkend="xfarcs">xfarcs</link>
570
<para>Fill parts of a set of ellipses</para>
576
<title>Arrow plotting</title>
580
<link linkend="xarrows">xarrows</link>
583
<para>Draw a set of arrows</para>
589
<title>Strings</title>
593
<link linkend="xstring">xstring</link>
596
<para>Draw strings</para>
601
<link linkend="xstringl">xstringl</link>
604
<para>Compute a box which surrounds strings</para>
609
<link linkend="xstringb">xstringb</link>
612
<para>Draw strings into a box</para>
614
<emphasis role="bold">Example:</emphasis>
617
<scilab:image>xstringb();</scilab:image>
623
<link linkend="xtitle">xtitle</link>
626
<para>Add titles on a graphics window</para>
628
<emphasis role="bold">Example:</emphasis>
631
<scilab:image>xtitle();</scilab:image>
637
<link linkend="titlepage">titlepage</link>
640
<para>Add a title in the middle of a graphics window</para>
645
<link linkend="xinfo">xinfo</link>
648
<para>Draw an info string in the message subwindow</para>
654
<title>Frames and axes</title>
658
<link linkend="drawaxis">drawaxis</link>
661
<para>Draw an axis</para>
666
<link linkend="graduate">graduate</link>
669
<para>Pretty axis graduations</para>
674
<link linkend="plotframe">plotframe</link>
677
<para>Plot a frame with scaling and grids</para>
683
<title>Coordinates transformations</title>
687
<link linkend="isoview">isoview</link>
690
<para>Set scales for isometric plot (do not change the size of the window)</para>
695
<link linkend="square">square</link>
698
<para>Set scales for isometric plot (change the size of the window)</para>
703
<link linkend="scaling">scaling</link>
706
<para>Affine transformation of a set of points</para>
711
<link linkend="rotate">rotate</link>
714
<para>Rotation of a set of points</para>
719
<link linkend="xsetech">xsetech</link>
722
<para>Set the sub-window of a graphics window for plotting</para>
727
<link linkend="subplot">subplot</link>
730
<para>Divide a graphics window into a matrix of sub-windows</para>
735
<link linkend="xgetech">xgetech</link>
738
<para>Get the current graphics scale</para>
743
<link linkend="xchange">xchange</link>
746
<para>Transform real to pixel coordinates</para>
752
<title>Colors</title>
756
<link linkend="colormap">colormap</link>
759
<para>Using colormaps</para>
764
<link linkend="getcolor">getcolor</link>
767
<para>Dialog to select colors in the current colormap</para>
772
<link linkend="addcolor">addcolor</link>
775
<para>Add new colors to the current colormap</para>
780
<link linkend="graycolormap">graycolormap</link>
783
<para>Linear gray colormap</para>
788
<link linkend="hotcolormap">hotcolormap</link>
791
<para>Red to yellow colormap</para>
797
<title>Graphics context</title>
801
<link linkend="xset">xset</link>
804
<para>Set values of the graphics context</para>
809
<link linkend="xget">xget</link>
812
<para>Get current values of the graphics context</para>
817
<link linkend="xlfont">xlfont</link>
820
<para>Load a font in the graphics context or query loaded font</para>
825
<link linkend="getsymbol">getsymbol</link>
828
<para>Dialog to select a symbol and its size</para>
834
<title>Save and load</title>
838
<link linkend="xsave">xsave</link>
841
<para>Save graphics into a file</para>
846
<link linkend="xload">xload</link>
849
<para>Load a saved graphics</para>
854
<link linkend="xs2bmp">xs2bmp</link>
857
<para>Export graphics using the BMP format</para>
862
<link linkend="xs2emf">xs2emf</link>
865
<para>Export graphics using the EMF format</para>
870
<link linkend="xs2eps">xs2eps</link>
873
<para>Export graphics using the EPS format</para>
878
<link linkend="xs2gif">xs2gif</link>
881
<para>Export graphics using the GIF format</para>
886
<link linkend="xs2jpg">xs2jpg</link>
889
<para>Export graphics using the JPG format</para>
894
<link linkend="xs2pdf">xs2pdf</link>
897
<para>Export graphics using the PDF format</para>
902
<link linkend="xs2png">xs2png</link>
905
<para>Export graphics using the PNG format</para>
910
<link linkend="xs2ppm">xs2ppm</link>
913
<para>Export graphics using the PPM format</para>
918
<link linkend="xs2ps">xs2ps</link>
921
<para>Export graphics using the PS format</para>
926
<link linkend="xs2svg">xs2svg</link>
929
<para>Export graphics using the SVG format</para>
935
<title>Graphics primitives</title>
939
<link linkend="clf">clf</link>
942
<para>Clear a graphics window and erase the associated recorded graphics</para>
947
<link linkend="xclear">xclear</link>
950
<para>Clear a graphics window</para>
955
<link linkend="driver">driver</link>
958
<para>Select a graphics driver</para>
963
<link linkend="xinit">xinit</link>
966
<para>Initialisation of a graphics driver</para>
971
<link linkend="xend">xend</link>
974
<para>Close a graphics session</para>
979
<link linkend="xbasr">xbasr</link>
982
<para>Redraw a graphics window</para>
987
<link linkend="replot">replot</link>
990
<para>Redraw the current graphics window with new boundaries</para>
995
<link linkend="xpause">xpause</link>
998
<para>Suspend Scilab</para>
1003
<link linkend="show_window">show_window</link>
1006
<para>Raise the current graphics window</para>
1011
<link linkend="xdel">xdel</link>
1014
<para>Delete a graphics window</para>
1019
<link linkend="winsid">winsid</link>
1022
<para>Return the list of graphics windows</para>
1027
<link linkend="xname">xname</link>
1030
<para>Change the name of the current graphics window</para>
1036
<title>Mouse position</title>
1040
<link linkend="xclick">xclick</link>
1043
<para>Wait for a mouse click</para>
1048
<link linkend="locate">locate</link>
1051
<para>Mouse selection of a set of points</para>
1056
<link linkend="xgetmouse">xgetmouse</link>
1059
<para>Get the current position of the mouse</para>
1065
<title>Interactive editor</title>
1069
<link linkend="edit_curv">edit_curv</link>
1072
<para>Interactive graphics curve editor</para>
1078
<title>Graphics functions for automatic control</title>
1082
<link linkend="bode">bode</link>
1085
<para>Bode plot</para>
1087
<emphasis role="bold">Example:</emphasis>
1090
<scilab:image>s=poly(0,'s')
1091
h=syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01))
1092
clf();bode(h,0.01,100);
1099
<link linkend="gainplot">gainplot</link>
1102
<para>Magnitude plot</para>
1104
<emphasis role="bold">Example:</emphasis>
1107
<scilab:image>s=poly(0,'s')
1108
h1=syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01))
1109
h2=syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
1110
clf();gainplot([h1;h2],0.01,100,['h1';'h2'])
1118
<link linkend="nyquist">nyquist</link>
1121
<para>Nyquist plot</para>
1123
<emphasis role="bold">Example:</emphasis>
1126
<scilab:image>s=poly(0,'s')
1127
h=syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01));
1128
h1=h*syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
1131
h_h=ax.children($).children(2);
1132
tip=datatipCreate(h_h,[1.331,0.684]);
1133
datatipSetOrientation(tip,"upper left");
1140
<link linkend="m_circle">m_circle</link>
1143
<para>M-circle plot</para>
1145
<emphasis role="bold">Example:</emphasis>
1148
<scilab:image>m_circle();</scilab:image>
1154
<link linkend="chart">chart</link>
1157
<para>Nichols chart</para>
1159
<emphasis role="bold">Example:</emphasis>
1162
<scilab:image>chart();</scilab:image>
1168
<link linkend="black">black</link>
1171
<para>Black's diagram</para>
1173
<emphasis role="bold">Example:</emphasis>
1176
<scilab:image>s=poly(0,'s');
1177
sl=syslin('c',5*(1+s)/(.1*s^4+s^3+15*s^2+3*s+1))
1178
clf();black(sl,0.01,10);
1185
<link linkend="evans">evans</link>
1188
<para>Evans root locus</para>
1190
<emphasis role="bold">Example:</emphasis>
1193
<scilab:image>evans();</scilab:image>
1199
<link linkend="sgrid">sgrid</link>
1202
<para>s-plane grid lines</para>
1204
<emphasis role="bold">Example:</emphasis>
1207
<scilab:image>sgrid();</scilab:image>
1213
<link linkend="plzr">plzr</link>
1216
<para>pole-zero plot</para>
1218
<emphasis role="bold">Example:</emphasis>
1221
<scilab:image>s=poly(0,'s');
1222
n=[1+s 2+3*s+4*s^2 5; 0 1-s s];
1223
d=[1+3*s 5-s^3 s+1;1+s 1+s+s^2 3*s-1];
1232
<link linkend="zgrid">zgrid</link>
1235
<para>zgrid plot</para>
1237
<emphasis role="bold">Example:</emphasis>
1240
<scilab:image>zgrid();</scilab:image>