Graphics: Getting startedgraphics library overview2d plotting
plot2d
Plot a curveExample:plot2d();
plot2d2
Plot a curve as step functionExample:plot2d2();
plot2d3
Plot a curve with vertical barsExample:plot2d3();
plot2d4
Plot a curve with arrowsExample:plot2d4();
fplot2d
Plot a curve defined by a functionExample:fplot2d();
champ
2D vector fieldExample:champ();
champ1
2D vector field with colored arrowsExample:champ1();
fchamp
Direction field of a 2D first order ODEExample:fchamp();
contour2d
Level curves of a surface on a 2D plot
fcontour2d
Level curves of a surface defined by a function on a 2D plotExample:fcontour2d();
grayplot
2D plot of a surface using colorsExample:grayplot();
fgrayplot
2D plot of a surface defined by a function using colorsExample:fgrayplot();
Sgrayplot
Smooth 2D plot of a surface using colorsExample:Sgrayplot();
Sfgrayplot
Smooth 2D plot of a surface defined by a function using colorsExample:Sfgrayplot();
xgrid
Add a grid on a 2D plotExample:x=[0:0.1:2*%pi]'; plot2d(sin(x));xgrid(5)
errbar
Add vertical error bars on a 2D plotExample:errbar();
histplot
Plot a histogramExample:histplot();
Matplot
2D plot of a matrix using colorsExample:Matplot();3d plotting
plot3d
Plot a surfaceExample:plot3d();
plot3d1
Plot a surface with gray or color levelExample:plot3d1();
fplot3d
Plot a surface defined by a functionExample:fplot3d();
fplot3d1
Plot a surface defined by a function with gray or color levelExample:fplot3d1();
param3d
Plot one curveExample:param3d();
param3d1
Plots curvesExample:param3d1();
contour
Level curves on a 3D surfaceExample:contour();
fcontour
Level curves on a 3D surface defined by a functionExample:fcontour();
hist3d
3D representation of a histogramExample:hist3d();
genfac3d
Compute facets of a 3D surfaceExample:genfac3d();
eval3dp
Compute facets of a 3D surfaceExample:p1=linspace(0,2*%pi,10);
p2=linspace(0,2*%pi,10);
deff("[x,y,z]=scp(p1,p2)",["x=p1.*sin(p1).*cos(p2)";..
"y=p1.*cos(p1).*cos(p2)";..
"z=p1.*sin(p2)"])
[Xf,Yf,Zf]=eval3dp(scp,p1,p2);
plot3d(Xf,Yf,Zf)
geom3d
Projection from 3D on 2D after a 3D plotExample:deff("[z]=surface(x,y)","z=sin(x)*cos(y)")
t=%pi*(-10:10)/10;
// 3D plot of the surface
fplot3d(t,t,surface,35,45,"X@Y@Z")
// now (t,t,sin(t).*cos(t)) is a curve on the surface
// which can be drawn using geom3d and xpoly
[x,y]=geom3d(%pi/2,0,surface(%pi/2,0))
Line and polygon plotting
xpoly
Draw a polyline or a polygon
xpolys
Draw a set of polylines or polygons
xrpoly
Draw a regular polygon
xsegs
Draw unconnected segments
xfpoly
Fill a polygon
xfpolys
Fill a set of polygonsRectangle plotting
xrect
Draw a rectangle
xfrect
Fill a rectangle
xrects
Draw or fill a set of rectanglesArc plotting
xarc
Draw a part of an ellipse
xarcs
Draw parts of a set of ellipses
xfarc
Fill a part of an ellipse
xfarcs
Fill parts of a set of ellipsesArrow plotting
xarrows
Draw a set of arrowsStrings
xstring
Draw strings
xstringl
Compute a box which surrounds strings
xstringb
Draw strings into a boxExample:xstringb();
xtitle
Add titles on a graphics windowExample:xtitle();
titlepage
Add a title in the middle of a graphics window
xinfo
Draw an info string in the message subwindowFrames and axes
drawaxis
Draw an axis
graduate
Pretty axis graduations
plotframe
Plot a frame with scaling and grids
This function is obsolete.
Coordinates transformations
isoview
Set scales for isometric plot (do not change the size
of the window)
This function is obsolete.
square
Set scales for isometric plot (change the size of the window)
scaling
Affine transformation of a set of points
rotate
Rotation of a set of points
xsetech
Set the sub-window of a graphics window for plotting
subplot
Divide a graphics window into a matrix of sub-windows
xgetech
Get the current graphics scale
xchange
Transform real to pixel coordinatesColors
colormap
Using colormaps
getcolor
Dialog to select colors in the current colormap
addcolor
Add new colors to the current colormap
graycolormap
Linear gray colormap
hotcolormap
Red to yellow colormapGraphics context
xset
Set values of the graphics context
This function is obsolete.
xget
Get current values of the graphics context
This function is obsolete.
xlfont
Load a font in the graphics context or query loaded fontSave and load
xsave
Save graphics into a file
xload
Load a saved graphics
xs2bmp
Export graphics using the BMP format
xs2emf
Export graphics using the EMF format
Only under Windows.
xs2eps
Export graphics using the EPS format
xs2gif
Export graphics using the GIF format
xs2jpg
Export graphics using the JPG format
xs2pdf
Export graphics using the PDF format
xs2png
Export graphics using the PNG format
xs2ppm
Export graphics using the PPM format
xs2ps
Export graphics using the PS format
xs2svg
Export graphics using the SVG formatGraphics primitives
clf
Clear or reset the current graphic figure (window) to default values
xclear
Clear a graphics window
Function xclear is obsolete.
driver
Select a graphics driver
xinit
Initialisation of a graphics driver
xend
Close a graphics session
replot
Redraw the current graphics window with new boundaries
xpause
Suspend Scilab
show_window
Raise the current graphics window
xdel
Delete a graphics window
winsid
Return the list of graphics windows
xname
Change the name of the current graphics windowMouse position
xclick
Wait for a mouse click or an event in a graphic window
locate
Mouse selection of a set of points
xgetmouse
Get the mouse events and current positionInteractive editor
edit_curv
Interactive graphics curve editorGraphics functions for automatic control
bode
Bode plotExample:s=poly(0,'s')
h=syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01))
clf();bode(h,0.01,100);
gainplot
Magnitude plotExample:s=poly(0,'s')
h1=syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01))
h2=syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
clf();gainplot([h1;h2],0.01,100,['h1';'h2'])
title('Gainplot');
nyquist
Nyquist plotExample:s=poly(0,'s')
h=syslin('c',(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01));
h1=h*syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
nyquist(h1)
ax=gca();
h_h=ax.children($).children(2);
tip=datatipCreate(h_h,[1.331,0.684]);
datatipSetOrientation(tip,"upper left");
m_circle
Plot the complex plane iso-gain contours of y/(1+y)
This function is obsolete.
Example:m_circle();
hallchart
Hall chart
Example:hallchart();
nicholschart
Nichols chartExample:nicholschart();
black
Black's diagramExample:s=poly(0,'s');
sl=syslin('c',5*(1+s)/(.1*s^4+s^3+15*s^2+3*s+1))
clf();black(sl,0.01,10);
evans
Evans root locusExample:evans();
sgrid
s-plane grid linesExample:sgrid(0:0.2:1,[0.2 0.6 1 1.7 2])
plzr
pole-zero plotExample:s=poly(0,'s');
n=[1+s 2+3*s+4*s^2 5; 0 1-s s];
d=[1+3*s 5-s^3 s+1;1+s 1+s+s^2 3*s-1];
h=syslin('c',n./d);
plzr(h);
zgrid
zgrid plotExample:zgrid();