Previous Next Contents

2  Graphic Library

2.1   Graphics Graphic library for Scilab




DESCRIPTION :



GENERAL PLOTTING

plot3d
: 3d plotting of a matrix of point.

plot3d1
: 3d plotting of a matrix of point with gray levels.

fplot3d
: 3d plotting of a surface described by a function

fplot3d1
: 3d plotting of a surface described by a function with gray levels

plot2d
: for 2d plotting plot2d1,plot2d2,plot2d3,plot2d4

fplot2d: 2d plotting of a a curve described by a function

errbar
: adds error bars on a plot2d graphic

xgrid
: adds a grid on a 2d graphic.

xtitle
: adds title and axis names on a 2d graphic

param3d
: plots curves in 3d space

stair2d
: 2d piece-size constant plotting.

champ
: vector field in R2

fchamp
: for a vector field in R2 defined by a function

contour
: level curves for a 3d function given by a matrix.

grayplot10
: gray level on a 2d plot

fcontour10
: level curves for a 3d function given by a function.

fgrayplot10
: gray level on a 2D plot

xchange
: scale conversion between plot2d and pixels

gr_menu
: small interactive editor

hist3d
: 3d histogram

xrpoly
: graphic display of a regular polygon

titlepage
: graphic title page

POLYLINES PLOTTING

xpoly
: draws a polyline

xpolys
: draws a set of polylines

xfpoly
: fills a polygon

xfpolys
: fills a set of polygons

SEGMENTS PLOTTING

xsegs
: draws a set of unconnected segments.

ARROWS PLOTTING

xarrows
: draws a set of unconnected arrows.

RECTANGLES PLOTTING

xrect
: draws a single rectangle

xfrect
: fills a single rectangle

xrects
: fills or draws a set of rectangles

ARCS PLOTTING

xarc
: draws an ellipsis

xfarc
: fills an ellipsis

xarcs
: fills or draws a set of ellipsis.

STRINGS

xstring
: draws a string or a matrix of strings.

xstringl
: computes a rectangle which surrounds a string

xstringb
: draws a string in a specified box

xnumb
: draws a set of numbers

AXIS DRAWING

xaxis
: draws an axis.

UTILITIES

secto3d
: Conversion of a surface description from sector to plot3d compatible data.

eval3d
: evaluates a function on a regular grid. (see also feval)

COORDINATES TRANSFORMS

isoview
: isometric scale.

square
: isometric scale.

scaling
: scaling on datas

rotate
: rotation

xgetech,xsetech
: change of scale inside the graphic window (not fully released).

RECORDING

xtape
: record graphic instructions

PRINTING AND REDISPLAY

xbasc
: clears window and recorded graphics

xbasimp
: redisplays graphics to postscript printer

xbasr
: redisplays graphics

GRAPHICS PRIMITIVES

X-window and Postscript graphic primitives

driver
: to select a graphic driver

xinit
: to initialise a graphic driver

xclear
: clears one or more graphic windows

xpause
: a pause in milliseconds.

xselect
: raises the current graphic window.

xclick
: waits for a mouse click

xclea
: clears a rectangular zone inside the current graphic window.

xend
: closes a graphic session.

GRAPHIC CONTEXT

xset
: to set graphic context values

xget
: to get information on the current graphic context

xlfont
: to load a new family of fonts from the X-Window Manager

COLORS

colormap
: to get information on using colors

addcolor
: to add new colors in the colormap




Author : J.Ph C



2.2   Matplot 2D plot of a matrix using colors




CALLING SEQUENCE :

Matplot(A,[strf,rect,nax])



PARAMETERS :




DESCRIPTION :

The entries of matrix int(A) are used as colormap entries in the current colormap. The color associated to a(i,j) is used do draw a small square of length 1 and with center at location (x=j,y=(n2-i+1)). Enter the command Matplot() to see a demo.


EXAMPLE  :

 
Matplot([1,2,3;4,5,6])
// draw the colormap 
Matplot((1:xget("lastpattern")))



See Also : grayplot X


Author : J.Ph.C..



2.3   Sfgrayplot 2D plot with gray levels




CALLING SEQUENCE :

Sfgrayplot(x,y,f,[strf,rect,nax])



DESCRIPTION :

Like fgrayplot but the function fec is used to smooth the result. f is evaluated on the grid x.*.y and the result is plotted assuming that f is linear on the triangles built on the x.*.y grid. Enter Sfgrayplot() to see a demo.
    ______ 
    | /| /| 
    |/_|/_|  
    | /| /|
    |/_|/_|



EXAMPLE  :

Sfgrayplot()



Author : J.Ph.C..


See Also : Sgrayplot X, fgrayplot X, grayplot X, fec X



2.4   Sgrayplot 2D plot of a surface using gray levels




CALLING SEQUENCE :

Sgrayplot(x,y,z,[strf,rect,nax])



DESCRIPTION :

Like grayplot but the function fec is used to smooth the result. z gives the value of the function on the grid x.*.y . The function is plotted assuming that it is linear on a set triangles of triangles built from the grid. Type Sgrayplot() to see a demo
    ______ 
    | /| /| 
    |/_|/_|  
    | /| /|
    |/_|/_|



EXAMPLE :

Sgrayplot()



See Also : Sfgrayplot X, fgrayplot X, grayplot X, fec X


Author : J.Ph.C..



2.5   addcolor add new colors to current colormap




CALLING SEQUENCE :

new=addcolor(c)



PARAMETERS :




DESCRIPTION :

addcolor, adds new colors given in the c argument to current colormap. c must be a matrix with 3 columns [R G B] (R is red component, G is green component, B is blue component). Each entry in c must be a non negative number less or equal to 1.

If a color defined in c
is already present in current colormap it is not added.


See Also : colormap X



2.6   black Black's diagram (Nichols chart)




CALLING SEQUENCE :

black( sl,[fmin,fmax] [,step] [,comments] )
black( sl,frq [,comments] )
black(frq,db,phi [,comments])
black(frq,repf  [,comments]) 



PARAMETERS :




DESCRIPTION :

Black's diagram (Nichols'chart) for a linear system sl. sl can be a continuous-time or discrete-time SIMO system (see syslin). In case of multi-output the outputs are plotted with different symbols.

The frequencies are given by the bounds fmin,fmax
(in Hz) or by a row-vector (or a matrix for multi-output) frq.

step
is the ( logarithmic ) discretization step. (see calfrq for the choice of default value).

comments
is a vector of character strings (captions).

db,phi
are the matrices of modulus (in Db) and phases (in degrees). (One row for each response).

repf
matrix of complex numbers. One row for each response.

To plot the grid of iso-gain and iso-phase of y/(1+y)
use chart().

Default values for fmin
and fmax are 1.d-3, 1.d+3 if sl is continuous-time or 1.d-3, 0.5 if sl is discrete-time.


EXAMPLE :

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))
chart();
sstr='(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01)';
black(h,0.01,100,sstr);
h1=h*syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
xbasc()
black([h1;h],0.01,100,['h1';'h'])



See Also : bode X, nyquist X, chart X, freq X, repfreq X, calfrq X, phasemag X



2.7   bode Bode plot




CALLING SEQUENCE :

bode(sl,[fmin,fmax] [,step] [,comments] )
bode(sl,frq [,comments] )
bode(frq,db,phi [,comments])
bode(frq, repf  [,comments])



PARAMETERS :




DESCRIPTION :

Bode plot, i.e magnitude and phase of the frequency response of sl.

sl
can be a continuous-time or discrete-time SIMO system (see syslin). In case of multi-output the outputs are plotted with different symbols.

The frequencies are given by the bounds fmin,fmax
(in Hz) or by a row-vector (or a matrix for multi-output) frq.

step
is the ( logarithmic ) discretization step. (see calfrq for the choice of default value).

comments
is a vector of character strings (captions).

db,phi
are the matrices of modulus (in Db) and phases (in degrees). (One row for each response).

repf
matrix of complex numbers. One row for each response.

Default values for fmin
and fmax are 1.d-3, 1.d+3 if sl is continuous-time or 1.d-3, 0.5 if sl is discrete-time. Automatic discretization of frequencies is made by calfrq.


EXAMPLE :

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))
title='(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01)';
bode(h,0.01,100,title);
h1=h*syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
xbasc()
bode([h1;h],0.01,100,['h1';'h'])



See Also : black X, nyquist X, gainplot X, repfreq X, g_margin X, p_margin X, calfrq X, phasemag X



2.8   champ draw a 2d vector field




CALLING SEQUENCE :

champ(x,y,fx,fy [,arfact,rect,strf])
champ1(x,y,fx,fy [,arfact,rect,strf])



PARAMETERS :




DESCRIPTION  :

champ draws a 2d vector field. If ones uses champ the length of the arrows are proportional to the field intensity and if one uses champ1 (with a color screen) the color of the arrow depends on the intensity of the field.

Enter the command champ()
to see a demo.


EXAMPLE :

 
// using rect has graphic boundaries 
champ(-5:5,-5:5,rand(11,11),rand(11,11),1,[-10,-10,10,10],"011");
xgrid();
xbasc();
// using (x,y) to get boundaries 
champ(-5:5,-5:5,rand(11,11),rand(11,11),2,[-10,-10,10,10],"021");
// using coloured arrows
xset("use color",1)
champ1(-5:5,-5:5,rand(11,11),rand(11,11),2,[-10,-10,10,10],"021");



Author : J.Ph.C.



2.9   champ1 draw a 2d vector field




CALLING SEQUENCE :

champ1(x,y,fx,fy [,arfact,rect,strf])



DESCRIPTION  :

see champ



2.10   chart Nichols chart




CALLING SEQUENCE :

chart([flags])
chart(gain [,flags])
chart(gain,phase [,flags])



PARAMETERS :




DESCRIPTION :

plot the Nichols'chart.

The default values for gain
and phase are respectively :

[-12 -8 -6 -5 -4 -3 -2 -1.4 -1 -.5 0.25 0.5 0.7 1 1.4 2 2.3 3 4 5 6 8 12]


[-(1:10) , -(20:10:160)]


EXAMPLE :

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))
black(h,0.01,100,'(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01)')
chart(list(1,0,2,3));
Another example :
xbasc()
h1=h*syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
black([h1;h],0.01,100,['h1';'h'])
chart([-8 -6 -4],[80 120],list(1,0));

2.11   colormap Using colors in Scilab




DESCRIPTION :

Colormaps.


EXAMPLE :

m=228;
n = fix(3/8*m);
r = [(1:n)'/n; ones(m-n,1)];
g = [zeros(n,1); (1:n)'/n; ones(m-2*n,1)];
b = [zeros(2*n,1); (1:m-2*n)'/(m-2*n)];
h = [r g b];
xset('colormap',h);
plot3d1()



See Also : xget X, xset X



2.12   contour level curves of surface




CALLING SEQUENCE :

contour(x,y,z,nz,[theta,alpha,caption,flag,bbox,zlev])
contour2d(x,y,z,nz,[style,strf,leg,rect,nax])



PARAMETERS :




DESCRIPTION :

Draws level curves of a surface z=f(x,y). The level curves can be drawn on a 3D surface or on 2D plot. For level curves on a 2d plot, the function contour2d should be preferred to the function contour since it accepts standard 2d parameters [style,strf,leg,rect,nax]. for level curves on a 3d plot, the optional arguments are the same as for the function plot3d (except zlev ) and their meaning are the same. They control the drawing of level curves on a 3D plot. Only flag(1)=mode has a special meaning.

1


EXAMPLE :

contour2d(1:10,1:10,rand(10,10),5,1:5,"011"," ",[0,0,11,11]);



See Also : fcontour X, fcontour2d X


Author : J.Ph.C..



2.13   contour2d level curves of surface on a 2D graphics




CALLING SEQUENCE :

contour2d(x,y,z,nz,[style,strf,leg,rect,nax])



DESCRIPTION :

see contour


EXAMPLE :

contour2d(1:10,1:10,rand(10,10),5,1:5,"011"," ",[0,0,11,11]);

2.14   driver select a driver for plotting




CALLING SEQUENCE :

driver(driver_name)
current_driver=driver()



PARAMETERS  :




DESCRIPTION :

This function is used to select a graphic driver, or with no arguments to get the current driver name. Most of the time, a user can ignore this function and change its driver by calling high level functions such as xbasc or xbasimp. The selected driver can be one of the following :


See Also : xtape X, xbasc X, xbasimp X


Author : J.Ph.C.



2.15   edit_curv interactive graphic curve editor




CALLING SEQUENCE :

[x,y,ok,gc] = edit_curv(y)
[x,y,ok,gc] = edit_curv(x,y)
[x,y,ok,gc] = edit_curv(x,y,job)
[x,y,ok,gc] = edit_curv(x,y,job,tit)
[x,y,ok,gc] = edit_curv(x,y,job,tit,gc)



PARAMETERS :




DESCRIPTION :

edit_curv is an interactive graphic curve editor. To add a new point simply click at the desired location, the added point will be connected to the nearest end-point. to move a point click on it, drag the mouse to the new position and click to fix the new position


Author : Serge Steer



2.16   errbar add error tic on a graphic




CALLING SEQUENCE :

errbar(x,y,em,ep)



PARAMETERS :




DESCRIPTION :

Used to add vertical error bars on a 2D plot. x and y have the same meaning as in plot2d; em(i,j) and ep(i,j) stands for the error interval on the value y(i,j)

[y(i,j)-em(i,j),y(i,j)+ep(i,j)]


Enter the command errbar() to see a demo.


EXAMPLE :

x=0:0.1:2*%pi;
y=[sin(x);cos(x)]';x=[x;x]';plot2d(x,y);
errbar(x,y,0.05*ones(x),0.03*ones(x));



Author : J.Ph.C..



2.17   eval3d values of a function on a grid




CALLING SEQUENCE :

[z]=eval3d(fun,x,[y])



PARAMETERS :




DESCRIPTION :

This function returns a matrix z(n1,n2). z(i,j)=fun(x(i),y(j)). If the function fun doesn't accept arguments of type vector use the primitive feval.


EXAMPLE  :

  x=-5:5;y=x;
  deff('[z]=f(x,y)',['z= x.*y']);
  z=eval3d(f,x,y);
  plot3d(x,y,z);
// 
  deff('[z]=f(x,y)',['z= x*y']);
  z=feval(x,y,f);
  plot3d(x,y,z);



See Also : feval X


Author : Steer S.



2.18   eval3dp computes facets of a 3D parametrized surface




CALLING SEQUENCE :

[x,y,z]=eval3dp(fun,p1,p2)



PARAMETERS :




DESCRIPTION :

Computes a set of facets which describe a 3D surface. The facet number k is a four sided polygon stored in x(:,k),y(:,k),z(:,k). The function fun(p1,p2) computes the (x,y,z) coordinates of the corresponding point on the surface, But for efficiency the function fun is supposed to work with two vector arguments.


EXAMPLE :

  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)'])
  [x,y,z]=eval3dp(scp,p1,p2);
  plot3d(x,y,z)



See Also : eval3d X, plot3d X, feval X, genfac3d X



2.19   evans Evans root locus




CALLING SEQUENCE :

evans(H [,kmax])



PARAMETERS :




DESCRIPTION :

Gives the Evans root locus for a linear system in state-space or transfer form H(s) (syslin list). This is the locus of the roots of 1+k*H(s)=1+k*N(s)/D(s), in the complex plane. For a selected sample of gains k <= kmax, the imaginary part of the roots of D(s)+k*N(s) is plotted vs the real part.

To obtain the gain at a given point of the locus you can simply execute the following instruction : k=-1/real(horner(h,[1,%i]*locate(1)))
and click the desired point on the root locus. If the coordinates of the selected point are in the real 2 x 1 vector P=locate(1) this k solves the equation k*N(w) + D(w) =0 with w=P(1)+%i*P(2)=[1,%i]*P.


EXAMPLE :

H=syslin('c',352*poly(-5,'s')/poly([0,0,2000,200,25,1],'s','c'));
evans(H,100)
P=3.0548543 - 8.8491842*%i;    //P=selected point
k=-1/real(horner(H,P));
Ns=H('num');Ds=H('den');
roots(Ds+k*Ns)     //contains P as particular root
// Another one
xbasc();s=poly(0,'s');n=1+s;
d=real(poly([-1 -2 -%i %i],'s'));
evans(n,d,100);
//
xbasc();n=real(poly([0.1-%i 0.1+%i,-10],'s'));
evans(n,d,80);



See Also : kpure X, krac2 X, locate X



2.20   fac3d complex 3D surface plotting




CALLING SEQUENCE :

fac3d(x,y,z[,theta,alpha,leg,flag,ebox])
fac3d1(x,y,z[,theta,alpha,leg,flag,ebox])



PARAMETERS :




DESCRIPTION :

Draw the surface defined by a set of n1 facets of coordinates x(:,i), y(:,i), z(:,i) i=1:n1. In fact this function is nothing but plot3d.

Enter the command fac3d()
to see a demo.


See Also : plot3d X, eval3dp X, genfac3d X



2.21   fchamp draw a 2d vector field




CALLING SEQUENCE :

fchamp(f,t,xr,yr,[arfact,brect,strf])



PARAMETERS :




DESCRIPTION  :

the fchamp is used to draw a two dimensional vector field described by a a Scilab external.

Enter the command champ()
to see a demo.


EXAMPLE :

 deff('[xdot] = derpol(t,x)',['xd1 = x(2)';
           "xd2 = -x(1) + (1 - x(1)**2)*x(2)";
           "xdot = [ xd1 ; xd2 ]"]);
 xf= -1:0.1:1;
 yf= -1:0.1:1;
 fchamp(derpol,0,xf,yf);
 xbasc();
 fchamp(derpol,0,xf,yf,1,[-2,-2,2,2],"011");



Author : J.Ph.C.



2.22   fcontour level curves




CALLING SEQUENCE :

fcontour(xr,yr,f,nz,[theta,alpha,caption,flag,bbox,zlev])
fcontour2d(x,y,z,nz,[style,strf,leg,rect,nax])



PARAMETERS :




DESCRIPTION :

Draws the level curves of a surface z=f(x,y). The level curves can be drawn on a 3D surface or on 2D plot. For level curves on a 2d plot, the function fcontour2d should be preferred to the function fcontour since it accepts standard 2d parameters [style,strf,leg,rect,nax]. fcontour and fcontour2d call respectively contour and contour2d Enter the command fcontour() or fcontour2d to see a demo.


See Also : contour X, contour2d X


Author : J.Ph.C..



2.23   fcontour2d level curves of surface on a 2D graphics




CALLING SEQUENCE :

fcontour2d(x,y,z,nz,[style,strf,leg,rect,nax])



DESCRIPTION :

see fcontour



2.24   fec contour level of a function defined on a triangular mesh




CALLING SEQUENCE :

fec(x,y,triangles,func,no,Ntr,strflag,legend,brect,aaint) 



PARAMETERS :




DESCRIPTION  :

See the demo files demos/fec.

fec.ex1
is a simple demo file in which a mesh and a function on that mesh is completely built in Scilab syntax

fec.ex2
is an example for which the mesh and the function value where computed by an external mesh builder (amdba type mesh) and an external program. A set of macros ( provided in file macros.sci) can be used to read the data files in Scilab and plot the results.


See Also : Sfgrayplot X, Sgrayplot X



2.25   fgrayplot 2D plot with gray levels




CALLING SEQUENCE :

fgrayplot(x,y,f,[strf,rect,nax])



PARAMETERS :




DESCRIPTION :

2D plot of a surface using gray levels; f gives the analytic expression of the surface. z=f(x,y) is first computed on the grid specified by xr.yr then control is passed to the routine grayplot.

Enter the Scilab command fgrayplot()
to see a demo.


EXAMPLE  :

 
deff('[z]=surf(x,y)','z=x**2+y**2');
fgrayplot(-1:0.1:1,-1:0.1:1,surf,"111",[-2,-2,2,2]);



See Also : Sgrayplot X,Sfgrayplot X,grayplot X


Author : J.Ph.C..



2.26   fplot2d 2D plot of a curve defined by an external




CALLING SEQUENCE :

fplot2d(xr,f,[style,strf,leg,rect,nax])



PARAMETERS :




DESCRIPTION :

The curve is approximated by a piecewise linear interpolation using the points (xr(i),f(xr(i)).

Enter the command fplot2d()
to see a demo.


EXAMPLE  :

deff("[y]=f(x)","y=sin(x)+cos(x)");
fplot2d((0:0.1:10)*%pi/10,f);
fplot2d((0:0.1:10)*%pi/10,f,5);



Author : J.Ph.C..



2.27   fplot3d 3D plot of a surface defined by an external




CALLING SEQUENCE :

fplot3d(xr,yr,f,[theta,alpha,leg,flag,ebox])



PARAMETERS :




DESCRIPTION :

This routines plots a surface defined by an external f. the values of f on the grid defined by xr.yr are first computed using feval, then control is passed to the primitive plot3d.

Enter the command fplot3d()
to see a demo.


Author : J.Ph.C.



2.28   fplot3d1 gray level plotting of a surface




CALLING SEQUENCE :

fplot3d1(xr,yr,f [,theta,alpha,leg,flag,ebox])



PARAMETERS :

( ) : see fplot3d


DESCRIPTION :

This routines plots a surface defined by an external f. the value of f on the grid defined by xr.yr is first computed using feval, then control is passed to the primitive plot3d1.

Enter the command fplot3d1()
to see a demo.


Author : J.Ph.C.



2.29   gainplot magnitude plot




CALLING SEQUENCE :

gainplot(sl,fmin,fmax [,step] [,comments] )
gainplot(frq,db,phi [,comments])
gainplot(frq, repf  [,comments])



PARAMETERS  :




DESCRIPTION :

Same as Bode but plots only the magnitude.


EXAMPLE :

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))
gainplot(h,0.01,100,'(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01)')
xbasc()
h1=h*syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
gainplot([h1;h],0.01,100,['h1';'h'])



See Also : bode X, black X, nyquist X, freq X, repfreq X, g_margin X, p_margin X



2.30   genfac3d convert 3d datas to four sided facets




CALLING SEQUENCE :

[xx,yy,zz]=genfac3d(x,y,zmat [,mask])



PARAMETERS :




DESCRIPTION :

Converts 3d data ( two vectors x,y and a matrix z which code the surface z(i,j)=f(x(i),y(j)) ) to a four sided facets representation.


EXAMPLE :

t = linspace(0,2*%pi,10);
zmat=sin(t')*cos(t);
plot3d(t,t,zmat)
[xx,yy,zz]=genfac3d(t,t,zmat);
plot3d(xx,yy,zz)
plot3d([xx xx],[yy yy],[zz 4+zz])



See Also : plot3d X, eval3dp X



2.31   geom3d projection from 3D on 2D




CALLING SEQUENCE :

[x,y]=geom3d(x1,y1,z1)



PARAMETERS  :




DESCRIPTION :

After having used a 3d plotting function as plot3d, plot3d1 and param3d, this function gives the correspondence between a point in R3 space (x1(i),y1(i),z1(i)) and the corresponding point in the projected graphic plan (x(i),y(j)). all the graphical primitives working on (x,y) can then be used for superposition on a plot3d


EXAMPLE :

deff("[z]=surf(x,y)","z=sin(x)*cos(y)");
t=%pi*(-10:10)/10;
fplot3d(t,t,surf,35,45,"X@Y@Z");
    //Gives a plot3d
    //now  (t,t,sin(t).*cos(t) ) is a curve on the surface
    //which can be drawn using param3d or the following code
[x,y]=geom3d(t,t,sin(t).*cos(t));
xpoly(x,y,"lines")
    //adding a comment 
[x,y]=geom3d([0,0],[0,0],[5,0]);
xsegs(x,y);
xstring(x(1),y(1)," The point (0,0,0)");



Author : J.Ph.C.



2.32   getcolor dialog to select color(s) in the current colormap




CALLING SEQUENCE :

c=getcolor(title [,cini])
c=getcolor()



PARAMETERS :




DESCRIPTION :

getcolor opens a dialog choice box with as many palettes as cini vector size. Palettes depends on the current colormap.


See Also : xset X, xsetm X



2.33   getsymbol dialog to select a symbol an its size




CALLING SEQUENCE :

c=getsymbol(title)



PARAMETERS :




DESCRIPTION :

getsymbol opens a dialog choice box where user may select a symbol type n and size sz .


See Also : xset X, xsetm X



2.34   gr_menu simple interactive graphic editor




CALLING SEQUENCE :

[sd1]=gr_menu([sd,flag,no_frame])



PARAMETERS :




DESCRIPTION :

gr_menu is a simple interactive graphic editor. When you execute gr_menu(), three new menus, Objects, Settings and Edit are added to the current graphics window. Use the item Exit of menu Edit to exit gr_menu.

The created graphics are saved as a list which can be given to gr_menu
as an entry value.


Author : S.S. & J.Ph.C.



2.35   graduate pretty axis graduations




CALLING SEQUENCE :

[xi,xa,np]=graduate( xmi, xma,n1,n2)        
[xi,xa,np]=graduate( xmi, xma)



PARAMETERS  :




DESCRIPTION :

graduate looks for the minimum interval [xi,xa] and a number of tics np such that:

xi
<= xmi <= xma <= xa

xa - xi / np = k(10^n),k in [1 3 5] for an integer n

n1 < np < n2


EXAMPLE :

  y=(0:0.33:145.78)';
  xbasc();plot2d1('enn',0,y)
  [ymn,ymx,np]=graduate(mini(y),maxi(y))
  rect=[1,ymn,prod(size(y)),ymx];
  xbasc();plot2d1('enn',0,y,1,'011',' ',rect,[10,3,10,np])



See Also : xsetech X,plot2d X


Author : S. Steer 1992



2.36   graycolormap Linear gray colormap




CALLING SEQUENCE :

cmap=graycolormap(n)



PARAMETERS :




DESCRIPTION :

Computes a colormap with grays colors varying linearly


See Also : colormap X, xset X, plot3d1 X, hotcolormap X


EXAMPLE :

xset('colormap',graycolormap(32))
plot3d1() 

2.37   grayplot 2D plot of a surface using colors




CALLING SEQUENCE :

grayplot(x,y,z,[strf,rect,nax])



PARAMETERS :




DESCRIPTION :

The surface is given by values z(i,j)=f(x(i),y(j)) on a grid defined by x,y. Each rectangle on the grid is filled with a gray level depending on the average value of f on the corners of the rectangle.

Enter the command grayplot()
to see a demo.


EXAMPLE  :

 
x=-10:10;y=-10:10;m=rand(21,21);
grayplot(x,y,m,"111",[-20,-20,20,20]);



See Also : Sgrayplot X, Sfgrayplot X, fgrayplot X


Author : J.Ph.C..



2.38   hist3d 3D representation of an histogram




CALLING SEQUENCE :

hist3d(f [,theta,alpha,leg,flag,ebox])



PARAMETERS :




DESCRIPTION :

3 dimensional representation of an 2d histogram : the values associated to the intervals ([x(i) x(i+1)[ X [y(i) y(i+1)[) Enter the command hist3d() to see a demo.


See Also : plot3d X


Author : Steer S. & JPhilippe C.



2.39   histplot plot an histogram




CALLING SEQUENCE :

histplot(npoint,data,[style,strf,leg,rect,nax])



PARAMETERS  :




DESCRIPTION :

Enter the command histplot() to see a demo.



2.40   hotcolormap Yellow to red RGB colormap




CALLING SEQUENCE :

cmap=hotcolormap(n)



PARAMETERS :




DESCRIPTION :

Computes a colormap with hots colors varying from red to yellow


See Also : colormap X, xset X, plot3d1 X, graycolormap X


EXAMPLE :

xset('colormap',hotcolormap(32))
plot3d1() 

2.41   isoview set scales for isometric plot




CALLING SEQUENCE :

isoview(xmin,xmax,ymin,ymax)



PARAMETERS :




DESCRIPTION :

isoview(xmin,xmax,ymin,ymax) is used to set the graphic scales in order to have isometric scales on the X and Y axes. The requested values xmin, xmax, ymin, ymax must be contained in the computed frame of the graphic window. This function sets the current graphic scales and can be used in conjunction with graphic routines which request the current graphic scale ( strf="x0y" in plot2d ). This function does not modify the size of the graphic window.


EXAMPLE :

xbasc();
t=(0:0.1:2*%pi)';
isoview(-1,1,-1,1);
plot2d(sin(t),cos(t),1,'001')



See Also : square X


Author : Steer S.



2.42   locate mouse selection of a set of points




CALLING SEQUENCE :

[x]=locate([n,flag])



PARAMETERS  :




DESCRIPTION :

This function is used to get the coordinates of one or more points selected with the mouse on a graphic window. The coordinates are given using the current graphic scale. If flag = 1 a cross is drawn at location point each time the mouse is clicked.


See Also : xclick X


Author : S.S. & J.Ph.C



2.43   m_circle M-circle plot




CALLING SEQUENCE :

 m_circle()
 m_circle(gain)



PARAMETERS :




DESCRIPTION  :

m_circle is used with nyquist.


EXAMPLE  :

//Example 1 :
  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))
  nyquist(h,0.01,100,'(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01)')
  m_circle();
//Example 2:
  xbasc();
  h1=h*syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
  nyquist([h1;h],0.01,100,['h1';'h'])
  m_circle([-8 -6 -4]);



See Also : nyquist X, chart X, black X


Author : S.Steer.



2.44   milk_drop test for plot3d




CALLING SEQUENCE :

[z]=milk_drop(x,y)



PARAMETERS :




DESCRIPTION :

milk_drop is a function [z]=milk_drop(x,y) which can be used to test the function eval3d


Author : Steer S.



2.45   nyquist nyquist plot




CALLING SEQUENCE :

nyquist( sl,[fmin,fmax] [,step] [,comments] )
nyquist( sl, frq [,comments] )
nyquist(frq,db,phi [,comments])
nyquist(frq, repf  [,comments])



PARAMETERS :




DESCRIPTION :

Nyquist plot i.e Imaginary part versus Real part of the frequency response of sl.

For continous time systems sl(2*%i*%pi*w)
is plotted. For discrete time system or discretized systems sl(exp(2*%i*%pi*w*fd) is used ( fd=1 for discrete time systems and fd=sl('dt') for discretized systems )

sl
can be a continuous-time or discrete-time SIMO system (see syslin). In case of multi-output the outputs are plotted with different symbols.

The frequencies are given by the bounds fmin,fmax
(in Hz) or by a row-vector (or a matrix for multi-output) frq.

step
is the ( logarithmic ) discretization step. (see calfrq for the choice of default value).

comments
is a vector of character strings (captions).

db,phi
are the matrices of modulus (in Db) and phases (in degrees). (One row for each response).

repf
is a matrix of complex numbers. One row for each response.

Default values for fmin
and fmax are 1.d-3, 1.d+3 if sl is continuous-time or 1.d-3, 0.5 if sl is discrete-time.

Automatic discretization of frequencies is made by calfrq
.


EXAMPLE :

xbasc();
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));
comm='(s^2+2*0.9*10*s+100)/(s^2+2*0.3*10.1*s+102.01)';
nyquist(h,0.01,100,comm);
h1=h*syslin('c',(s^2+2*0.1*15.1*s+228.01)/(s^2+2*0.9*15*s+225))
xbasc();
nyquist([h1;h],0.01,100,['h1';'h'])
xbasc();nyquist([h1;h])



See Also : bode X, black X, calfrq X, freq X, repfreq X, phasemag X



2.46   param3d set of points or parametric curves in 3-D




CALLING SEQUENCE :

param3d(x,y,z,[theta,alpha,leg,flag,ebox]



PARAMETERS :




DESCRIPTION  :

param3d is used to obtain a graphic of a parametric curve in R3. Enter the command param3d() to see a demo.

Look at param3d1
for multi R3 parametric curves and R3 point drawing.


EXAMPLE  :

t=0:0.1:5*%pi;
param3d(sin(t),cos(t),t/10,35,45,"X@Y@Z",[2,3])
xbasc();
xset("dashes",3)
param3d(rand(1,100),rand(1,100),rand(1,100),35,45,"X@Y@Z",[2,3])



See Also : param3d1 X


Author : J.Ph.C.



2.47   param3d1 set of points or parametric curves in 3-D




CALLING SEQUENCE :

param3d1(x,y,z,[theta,alpha,leg,flag,ebox]
param3d1(x,y,list(z,colors),[theta,alpha,leg,flag,ebox]



PARAMETERS :




DESCRIPTION  :

param3d1 is used to obtain a graphic of a parametric curve in R3, and can also be used to see a set of points in R3

Enter the command param3d1()
to see a demo.


EXAMPLE  :

t=0:0.1:5*%pi; t=t';
param3d1([sin(t),sin(2*t)],[cos(t),cos(2*t)],...
        list([t/10,sin(t)],[3,2]),35,45,"X@Y@Z",[2,3])



See Also : param3d X


Author : J.Ph.C.



2.48   param3di parametric curves in 3-D with interactive view selection




CALLING SEQUENCE :

param3di(x,y,z,[theta,alpha,leg,flag,ebox]



PARAMETERS :




DESCRIPTION :

Draw the 3D curve f(x,y) and allow the user to change the view with the mouse :

Pick a point within the graphic window (Left mouse button) and drag the mouse (theta increases for left to right move and alpha increases for down to up move). When view is ok click with the left button to have the surface drawn. click right button to exit.

For Pos and Fig drivers plot3di works just like plot3d

Enter the command param3di()
to see a demo.


Author : S Steer INRIA



2.49   plot simple plot




CALLING SEQUENCE :

plot(x,y,[xcap,ycap,caption])
plot(y,[xcap,ycap,caption])



PARAMETERS  :




DESCRIPTION :

plot y as function of x. xcap and ycap are captions for x-axis and y-axis respectively. Invoked with one argument, plot(y) plots the y vector or, if y is a matrix, its rows.


See Also : plot2d X


Author : J.Ph.C..



2.50   plot2d multiple plot of functions




CALLING SEQUENCE :

plot2d(x,y,[style,strf,leg,rect,nax])
plot2d(y);



PARAMETERS  :




DESCRIPTION :

plot2d simultaneously plot a set of 2D curves which are given by a set of points using piecewise linear plotting

Enter the command plot2d()
to see a demo.


EXAMPLE :

x=0:0.1:2*%pi;
//simple plot
plot2d(sin(x));
//multiple plot
xbasc();
plot2d([x;x;x]',[sin(x);sin(2*x);sin(3*x)]');
//multiple plot with captions
xbasc();
plot2d([x;x;x]',[sin(x);sin(2*x);sin(3*x)]',...
[1,2,3],"111","L1@L2@L3",[0,-2,2*%pi,2],[2,10,2,10]);
// isoview
xbasc(); 
plot2d(x',sin(x)',1,'041')
// auto scale 
xbasc();
plot2d(x',sin(x)',1,'061') 



See Also : plot2d1 X, plot2d2 X, plot2d3 X, plot2d4 X


Author : J.Ph.C..



2.51   plot2d1 multiple plot of functions




CALLING SEQUENCE :

plot2d1(str,x,y,[style,strf,leg,rect,nax])



PARAMETERS :




DESCRIPTION :

plot2d1 simultaneously plot a set of 2D curves. Same as plot2d but with one more argument str which enables logarithmic axis, and less specification for x.

Enter the command plot2d1()
to see a demo.


See Also : plot2d X


Author : J.Ph.C..



2.52   plot2d2 multiple plot of functions (step function)




CALLING SEQUENCE :

plot2d2(str,x,y,[style,strf,leg,rect,nax])



PARAMETERS :

[ ] : see plot2d1 and plot2d for a description of parameters.


DESCRIPTION :

Same as plot2d1 but the functions given by the set of points (x,y) which are to be drawn are supposed to be piecewise constant.

Enter the command plot2d2()
to see a demo.


EXAMPLE :

 
plot2d2("gnn",(1:4)',(1:4)',1,'111','step function',[0,0,5,5])
will plot a step function of value i on the segment (i,i+1). the last segment is not drawn.


See Also : plot2d X, plot2d1 X, plot2d3 X


Author : J.Ph.C..



2.53   plot2d3 multiple plot of functions (vertical bars)




CALLING SEQUENCE :

plot2d3(str,x,y,[style,strf,leg,rect,nax])



PARAMETERS :

see plot2d and plot2d1


DESCRIPTION :

Same as plot2d1 but curves are plotted using vertical bars.

Enter the command plot2d3()
to see a demo.


See Also : plot2d X, plot2d1 X, plot2d2 X, plot2d4 X


Author : J.Ph.C..



2.54   plot2d4 multiple plot of functions




CALLING SEQUENCE :

plot2d4(str,x,y,[style,strf,leg,rect,nax])



PARAMETERS :

see plot2d and plot2d1


DESCRIPTION :

Same as plot2d1 but curves are plotted using arrows style. This can be useful when plotting solutions of ode in a phase space.

Enter the command plot2d4()
to see a demo.


See Also : plot2d X, plot2d1 X


Author : J.Ph.C..



2.55   plot3d surface plotting




CALLING SEQUENCE :

plot3d(x,y,z [,theta,alpha,leg [,flag,ebox]])
plot3d(xf,yf,zf [,theta,alpha,leg [,flag,ebox]])
plot3d(xf,yf,list(zf,colors) [,theta,alpha,leg [,flag,ebox]])



PARAMETERS :

ebox=[xmin,xmax,ymin,ymax,zmin,zmax]


DESCRIPTION :

plot3d(x,y,z,theta,alpha,leg [,flag,ebox]) draw the surface z=f(x,y) defined by a matrix of coordinates.

plot3d(xf,yf,zf,theta,alpha,leg [,flag,ebox])
draw the non projectable surface 0=f(x,y,z) defined by a set of facets. xf(:,i),yf(:,i),zf(:,i) are respectively the x-axis,y-axis and z-axis coordinates of the ith facet.

Enter the command plot3d()
to see a demo.


EXAMPLE :

plot3d(1:10,1:20,10*rand(10,20),35,45,"X@Y@Z",[2,2,3])
xbasc();
t=(0:0.3:2*%pi)';zmat=sin(t)*cos(t');
[xx,yy,zz]=genfac3d(t,t,zmat);
plot3d([xx xx],[yy yy],[zz 4+zz]);
xbasc();
plot3d([xx xx],[yy yy],list([zz zz+4],[4*ones(1,400) 5*ones(1,400)]))



See Also : plot3d1 X, genfac3d X, hist3d X, geom3d X, param3d X


Author : J.Ph.C.



2.56   plot3d1 gray or color level plotting of a surface.




DESCRIPTION :

plot3d1(x,y,z,[theta,alpha,leg,flag,ebox])
plot3d1(xf,yf,zf [,theta,alpha,leg [,flag,ebox]])



PARAMETERS :

see plot3d for a full description. There's just a slight difference, the value of the mode parameter is unused, only its sign. If the sign is negative the grid is not drawn.


DESCRIPTION :

plots a surface z=f(x,y) (points) with colors depending on the z-level of the surface. Enter the command plot3d1() to see a demo or fac3d1().


EXAMPLE  :

plot3d1(1:10,1:20,10*rand(10,20),35,45,"X@Y@Z",[2,2,3]);
xbasc();
plot3d1(1:10,1:20,10*rand(10,20),35,45,"X@Y@Z",[-2,2,3]);
xbasc();
t=(0:0.3:2*%pi)';zmat=sin(t)*cos(t');
[xx,yy,zz]=genfac3d(t,t,zmat);
plot3d1([xx xx],[yy yy],[zz 4+zz]);
xbasc();
plot3d1([xx xx],[yy yy],list([zz zz+4],[4*ones(1,400) 5*ones(1,400)]))



Author : J.Ph.C.



2.57   plotframe graphic frame with scaling and grids




CALLING SEQUENCE :

plotframe(rect,tics [,arg_opt1,arg_opt2,arg_opt3])



PARAMETERS :




DESCRIPTION :

This function is used with plotting functions plot2d, plot2d1,... to set a graphic frame. This function is used before plot2d... which should be invoked with the "000" superposition mode.


EXAMPLE :

x=[-0.3:0.8:27.3]';
y=rand(x);
rect=[min(x),min(y),max(x),max(y)];
tics=[4,10,2,5];    //4 x-intervals and 2 y-intervals
plotframe(rect,tics,[%f,%f],['My plot','x','y'],[0,0,0.5,0.5]);
plot2d(x,y,2,'000')
plotframe(rect,tics,[%t,%f],['My plot with grids','x','y'],[0.5,0,0.5,0.5]);
plot2d(x,y,3,'000')
plotframe(rect,tics,[%t,%t],...
['My plot with grids and automatic bounds','x','y'],[0,0.5,0.5,0.5]);
plot2d(x,y,4,'000')
plotframe(rect,tics,[%f,%t],...
        ['My plot without grids but with automatic bounds','x','y'],...
        [0.5,0.5,0.5,0.5]);
plot2d(x,y,5,'000');
xset('default');



See Also : plot2d X, graduate X, xtitle X, plot2d1 X, plot2d2 X



2.58   plzr pole-zero plot




CALLING SEQUENCE :

plzr(sl) 



PARAMETERS :




DESCRIPTION :

produces a pole-zero plot of the linear system sl (syslin list)


EXAMPLE :

 
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);



See Also : trzeros X, roots X, syslin X



2.59   printing printing scilab graphics




CALLING SEQUENCE :

Blatexpr xscale yscale filename.ps
BEpsf filename.ps 
Blpr "Title" filename1.ps filename2.ps ... filenamen.ps | lpr 



DESCRIPTION :

The scilab graphics can be saved with the xbasimp command into unix files. The Scilab command :
 
        xbasimp(xx,'des.ps',0)
will save the graphics recorded in the graphic window xx in the file des.ps.xx. This file can't be directly send to a Postscript printer and a set of programs ( in the bin Scilab directory ) are given with Scilab to print it :


See Also : xbasimp X



2.60   rotate geometric rotation of a set of points




CALLING SEQUENCE :

[xy1]=rotate(xy,[theta,orig])



PARAMETERS  :




DESCRIPTION :

xy1(:,i) = M(theta) *xy(:,i) + orig where M stands for a rotation matrix of angle theta


EXAMPLE  :

 
xsetech([0,0,1,1],[-1,-1,1,1])
xy=[(0:0.1:10);sin(0:0.1:10)]/10;
for i=2*%pi*(0:10)/10,[xy1]=rotate(xy,i);
        xpoly(xy1(1,:),xy1(2,:),"lines")
end

2.61   scaling affine transform of a set of points




CALLING SEQUENCE :

[xy1]=scaling(xy,factor,orig)



PARAMETERS  :




DESCRIPTION :

xy1(:,i) = factor *xy(:,i) + orig



2.62   sd2sci gr_menu structure to scilab instruction convertor




CALLING SEQUENCE :

txt=sd2sci(sd [,sz [,orig]])



PARAMETERS :




DESCRIPTION :

given a sd data structure generated by gr_menu sd2sci forms a vector of scilab instructions corresponding to the graphic edited by gr_menu.

The optional parameters sz
and orig allows to zoom and shift the initial graphic.

If sz
or orig are given by strings generated instructions are relative use then as formal expressions.


Author : Serge Steer INRIA 1988


See Also : gr_menu X, execstr X



2.63   secto3d 3D surfaces conversion




CALLING SEQUENCE :

[m[,x]]=secto3d(seclist,npas)
[m]=secto3d(seclist ,x) 



PARAMETERS :




DESCRIPTION :

Considering a surface given through a list seclist of sections in the (x,z) plane [m [,x]]=secto3d(seclist [,npas]) returns a matrix m which contains a regular discretization of the surface. Each section seclist(i) is described by a (2,.) matrix which gives respectively the x and z coordinates of points.

[m]=secto3d(seclist ,x)
: in that case the x-vector gives the discretization of the x-axis for all the sections


See Also : plot3d X


Author : Steer S.



2.64   sgrid s-plane grid lines.




CALLING SEQUENCE :

sgrid()
sgrid('new')
sgrid(zeta,wn [,color])



DESCRIPTION :

Used in conjonction with evans, plots lines of constant damping ratio (zeta) and natural frequency (wn).

1


EXAMPLE :

H=syslin('c',352*poly(-5,'s')/poly([0,0,2000,200,25,1],'s','c'));
evans(H,100)
sgrid()
sgrid(0.6,2,7)



See Also : evans X



2.65   square sets scales for isometric graphics




CALLING SEQUENCE :

square(xmin,ymin,xmax,ymax)



PARAMETERS :




DESCRIPTION :

square(xmin,ymin,xmax,ymax) is used to set the graphic scales in order to have isometric scales on the X and Y axes. The requested values xmin, xmax, ymin, ymax are the boundaries of the graphic frame and this function changes the graphic window dimensions in order to get an isometric plot. This function sets the current graphic scales and can be used in conjunction with graphic routines which request the current graphic scale ( fstrf="x0y" in plot2d ).


See Also : isoview X


Author : Steer S.



2.66   titlepage display a matrix of strings




CALLING SEQUENCE :

titlepage(str)



PARAMETERS :




DESCRIPTION :

titlepage(str) displays the matrix str in the current graphic window with a size font as large as possible


See Also : xtitle X


Author : S. S.



2.67   winsid return the list of graphic windows id




CALLING SEQUENCE :

[x]=winsid()



PARAMETERS  :




DESCRIPTION :

This function is used to get the list of graphic windows id.



2.68   xarc draws a part of an ellipsis




CALLING SEQUENCE :

xarc(x,y,w,h,a1,a2)



PARAMETERS :




DESCRIPTION :

Draws a portion of an ellipsis contained in the rectangle (x,y,w,h) ( Upper-Left point, Width, Height), and in the sector delimited by the angle alpha1 and the angle alpha1+alpha2. alpha1 and alpha2 are given respectively by a1/64 degrees and a2/64 degrees. This function uses the current graphic state and graphic scale. which can be set by calling a high level drawing function such as plot2d.


EXAMPLE :

// isoview scaling 
plot2d(0,0,-1,"031"," ",[-2,-2,2,2])
xset("dashes",3);
xarc(-1,1,2,2,0,90*64)
xarc(-1.5,1.5,3,3,0,360*64)



See Also : xarcs X, xfarc X


Author : J.Ph.C..



2.69   xarcs drawing a set of ellipsis




CALLING SEQUENCE :

[]=xarcs(arcs,[style])



PARAMETERS :




DESCRIPTION :

draws a set of ellipsis described by arcs. arcs= [ x,y,w,h,a1,a2 ; x,y,w,h,a1,a2 ;.....] ' : each ellipsis is defined by the 6 parameters (x,y,w,h,a1,a2) (see xarc)

style(i)
gives the dash style which must be used to draw the ellipsis number i.


EXAMPLE  :

 
plot2d(0,0,-1,"031",' ',[-1,-1,1,1])
set_arcs=[ -1.0 0.0 0.5 // upper left x
            1.0 0.0 0.5 // upper left y
            0.5 0.5 0.5 // widths 
            0.5 0.5 0.5 // height 
            0.0 0.0 0.0 // angle 1
            360*64 360*64 360*64] // angle 2
xarcs(set_arcs,[1,2,3])



Author : J.Ph.C.



2.70   xarrows draw a set of arrows




CALLING SEQUENCE :

[]=xarrows(nx,ny,[arsize,style])



PARAMETERS :




DESCRIPTION :

This function draws a set of arrows which are given by the vector or matrices nx and ny. The ith arrow is defined by (nx(i),ny(i))-->(nx(i+1),ny(i+1)). nx, ny can also be matrices :
nx=[ xi_1,x1_2,...; xf_1,xf_2,...]
ny=[ yi_1,y1_2,...; yf_1,yf_2,...]
in which case the arrows are (xi_k,yi_k)->(xf_k,yf_k)

This function uses the current graphic scale which can be set by calling a high level drawing function such as plot2d.


EXAMPLE :

x=2*%pi*(0:9)/8;
x1=[sin(x);9*sin(x)];
y1=[cos(x);9*cos(x)];
plot2d([-10,10],[-10,10],[-1,-1],"022");
xset('clipgrf')
xarrows(x1,y1,1,1:10);
xset('clipoff')



See Also : plot2d X, xchange X


Author : J.Ph.C..



2.71   xaxis draws an axis




CALLING SEQUENCE :

[]=xaxis(alpha,nsteps,size,init)



PARAMETERS :




DESCRIPTION :

Draw an axis in the alpha (in degree ) direction; nsteps ([n1,n2]) gives the number of big and small intervals separated by tics. size=[s1,s2,c1] : s1 gives the size of the intervals , s2 gives the size of the small tics along the axis and s2*c1 is the size of the big tics. The size are given using the Scilab current x-scale and y-scale and are given as dimensions along the drawn axis.

 
            ex : n1=3,n2=2,alpha =0
                                               (s2*c1) 
            |     (s2)   |            |           |
            |______|_____|_____|______|_____|_____|
               s1



EXAMPLE  :

 
plot2d((1:0.1:10),sin(1:0.1:10))
xaxis(-90,[2,5],[0.1,0.1,2],[8,0])
xaxis(0,[2,3],[0.5,0.1,2],[5,0])



Author : J.Ph.C..



2.72   xbasc clear a graphic window and erase associated recorded graphics




CALLING SEQUENCE :

xbasc([win_num])



PARAMETERS :




DESCRIPTION :

clears the graphic window win_num and erase the recorded graphics. If win_num is omitted, it's the current graphic window. win_num can also be a vector of window Id to clear a set of windows


See Also : xclear X



2.73   xbasimp send graphics to a postscript printer or in a file




CALLING SEQUENCE :

xbasimp(win_num,[filen,printer])



PARAMETERS :




DESCRIPTION :

This function will send the recorded graphics of the window win_num in the Postscript file filen and will print the Postscript file with the command Blpr. This function will work only if the selected driver is "Rec"

If fwin_num is a vector several files are generated,one for each selected window (with names filenxx), and the files are printed on a unique page with the command Blpr,

The window number is appended to filen
.


See Also : printing X



2.74   xbasr redraw a graphic window




CALLING SEQUENCE :

xbasr(win_num)



DESCRIPTION :

This function is used to redraw the content of the graphic window of id win_num. It works only with the driver "Rec".


See Also : xtape X, driver X


Author : J.Ph.C.



2.75   xchange coordinates transform




CALLING SEQUENCE :

[x1,y1,rect]=xchange(x,y,dir)



PARAMETERS :




DESCRIPTION :

After having used a graphic function, this function allows one to change real coordinates into pixel coordinates and vice-versa, according to the value of the parameter dir. dir = 'f2i' or 'i2f' ( float to int or int to float) x1,y1 are the coordinates of the set of points described by x,y after the coordinate change.


Author : J.Ph.C..



2.76   xclea erase a rectangle on a graphic window




CALLING SEQUENCE :

xclea(x,y,w,h)



PARAMETERS  :




DESCRIPTION :

clears on the current graphic window the rectangle [x,y,w,h] ( Upper left point , width,height) using the current graphic scale.


Author : J.Ph.C.



2.77   xclear clear a graphic window




CALLING SEQUENCE :

xclear([window-id])



PARAMETERS :




DESCRIPTION :

Without any argument, this function wipes out the current window. Otherwise it wipes out the graphic windows whose numbers are included in the vector window-id, for example xclear(1:3). If one of the windows does not exist then it is automatically created.

Warning : in recording mode the graphic command xclear
wipes out the window, but it doesn't wipe out the recorded commands. In this case one must use the function xbasc.


See Also : xbasc X


Author : J.Ph.C.



2.78   xclick wait for a mouse click




CALLING SEQUENCE :

[c_i,c_x,c_y]=xclick([flag])
[c_i,c_x,c_y,c_w]=xclick([flag])
[c_i,c_x,c_y,c_w,c_m]=xclick([flag])



PARAMETERS :




DESCRIPTION :

if called with 3 lhs arguments waits for a mouse click in the current graphic window

if called with 4 or 5 lhs arguments waits for a mouse click in any graphic window

returned values:



KNOWN TROUBLES :

This function can return the message Can't grab the pointer if the graphic window is iconified when calling the function xclick.


See Also : locate X


Author : J.Ph.C.



2.79   xclip set a clip zone




CALLING SEQUENCE :

xclip([x,y,w,h])
xclip(rect)
xclip("clipgrf");



PARAMETERS :




DESCRIPTION :

Sets a clip region given by the coordinates, in the current graphic scaling, of a rectangle (x,y,w,h) (Upper-Left point,Width aba Height). If only one argument is used it stands for a rectangle specification rect=[x,y,w,h].

xclip("clipgrf")
is used to clip the usual graphic rectangle.

To unclip a region use the command xclip()



EXAMPLE :

x=0:0.2:2*%pi;
x1=[sin(x);100*sin(x)];
y1=[cos(x);100*cos(x)];
y1=y1+20*ones(y1);
// No clip 
plot2d([-100,500],[-100,600],[-1,-1],"022");
xsegs(10*x1+200*ones(x1),10*y1+200*ones(y1));
xbasc()
// 
// Rect clip 
xbasc();plot2d([-100,500],[-100,600],[-1,-1],"022");
xrect(150,460,100,150);
xclip(150,460,100,150);
xsegs(10*x1+200*ones(x1),10*y1+200*ones(y1));
//
// usual graphic rectangle clip 
xbasc();plot2d([-100,500],[-100,600],[-1,-1],"022");
xclip("clipgrf");
xsegs(10*x1+200*ones(x1),10*y1+200*ones(y1));
// clipping off
xclip()



Author : J.Ph.C.



2.80   xdel delete a graphic window




CALLING SEQUENCE :

xdel([win-num]) 



DESCRIPTION :

Deletes the graphic window win-num if the name is specified or the current graphic window otherwise


Author : J.Ph.C.



2.81   xend ends a graphic session




CALLING SEQUENCE :

xend()



DESCRIPTION :

This command is used to end a graphic session. Under the Postscript or Xfig drivers this command closes the current file which was opened by the command xinit.


Author : J.Ph.C.



2.82   xfarc fill a part of an ellipsis




CALLING SEQUENCE :

[]=xfarc(x,y,w,h,a1,a2)



PARAMETERS :




DESCRIPTION :

Fills a portion of an ellipsis contained in the rectangle (x,y,w,h) ( upper-left point, width, height), and in the sector delimited by the angle alpha1 and the angle alpha1+alpha2. alpha1 and alpha2 are given respectively by a1/64 degrees and a2/64 degrees. This function uses the current graphic state which can be set by calling a high level drawing function such as plot2d.


EXAMPLE :

// isoview scaling 
plot2d(0,0,-1,"031"," ",[-2,-2,2,2])
xfarc(-0.5,0.5,1,1,0,90*64)
xset("pattern",2)
xfarc(0.5,0.5,1,1,0,360*64)



See Also : xarcs X, xarc X


Author : J.Ph.C..



2.83   xfarcs filling a set of ellipsis




CALLING SEQUENCE :

[]=xfarcs(arcs,[fill])



PARAMETERS :




DESCRIPTION :

fill a set of ellipsis described by arcs. arcs= [ x,y,w,h,a1,a2 ; x,y,w,h,a1,a2 ;.....] ' : each ellipsis is defined by the 6 parameters (x,y,w,h,a1,a2) (see xarc)

fill(i)
gives the fill pattern or color which must be used to draw the ellipsis number i.


EXAMPLE  :

 
plot2d(0,0,-1,"031",' ',[-1,-1,1,1])
set_arcs=[ -1.0 0.0 0.5 // upper left x
            1.0 0.0 0.5 // upper left y
            0.5 0.5 0.5 // widths 
            0.5 0.5 0.5 // height 
            0.0 0.0 0.0 // angle 1
            360*64 360*64 360*64] // angle 2
xfarcs(set_arcs,[1,2,3])



Author : J.Ph.C.



2.84   xfpoly fill a polygon




CALLING SEQUENCE :

[]=xfpoly(xv,yv,[close])



PARAMETERS :




DESCRIPTION :

Fills a polygon with the current pattern. If close is equal to 1 a point is added to the polyline xv,yv to define a polygon.


EXAMPLE :

 
x=sin(2*%pi*(0:5)/5);
y=cos(2*%pi*(0:5)/5);
plot2d(0,0,-1,"010"," ",[-2,-2,2,2])
xset("pattern",5);
xfpoly(x,y)
xset("default");



See Also : xfpolys X


Author : J.Ph.C.



2.85   xfpolys fill a set of polygons of the same size




CALLING SEQUENCE :

[]=xfpolys(xpols,ypols,[fill])



PARAMETERS :




DESCRIPTION :

fills a set of polygons of the same size defined by the two matrices xpols,ypols . xpols= [ xpol1;xpol2;...]', each column of the matrix xpols gives the x-values of the points of a polygon (i.e ypols).

fill(i)
gives the id of the pattern for filling the polygon number i


EXAMPLE :

plot2d(0,0,[-1],"012"," ",[0,-10,210,40]);
x1=[0,10,20,30,20,10,0];
y1=[15,30,30,15,0,0,15];
xpols=[x1;x1;x1;x1]';xpols=xpols + [0,60,120,180].*.ones(x1)';
ypols=[y1;y1;y1;y1]';
lpat=xget("lastpattern");
// setting the current dash (or line color)
xset("dashes",5);
xfpolys(xpols,ypols,[-1,0,1,2]);
xset("default");



Author : J.Ph.C.



2.86   xfrect fill a rectangle




CALLING SEQUENCE :

[]=xfrect(x,y,w,h)



PARAMETERS :




DESCRIPTION :

fills a rectangle [x,y,w,h] (upper-left point, width, height) using current scale and pattern


EXAMPLE :

 
plot2d(0,0,-1,"010"," ",[-2,-2,2,2])
xset("pattern",5);
xfrect(-1,1,2,2)
xset("default");



Author : J.Ph.C.



2.87   xget gets current values of the graphic context




CALLING SEQUENCE :

[x1]=xget(str [,flag])
xget()



PARAMETERS :




DESCRIPTION :

this function is used to get values from the graphic context on the topic specified by the string str. When called no arguments, a choice menu is created showing the current values and changes can be performed through toggle buttons


See Also : xset X, colormap X


REFERENCE :

X11 documentation


Author : J.Ph.C.



2.88   xgetech get the current graphic 2d scale




CALLING SEQUENCE :

[frect1,frect,[logflag]]=xgetech()



PARAMETERS :




DESCRIPTION :

This function returns the current graphic scale. If one uses the current graphic scale, the points in the frect rectangle [xmin,ymin,xmax,ymax] will be drawn in the the region of the current graphic window specified by frect1.

frect1=[x,y,w,h]
( Upper-Left Width Height ) describes a region inside the graphic window. The values in wrect1 are specified using proportion of the width or height of the graphic window.

frect1=[0,0,1.0,1.0]
means that all the graphic window will be used.

frect1=[0.5,0,0.5,1.0]
means that the graphic region will be the right half of the graphic window. The logflag is a string of size 2 "xy", where x and y can be "n" or "l". It gives information on the log scale status for the current scale, "n" stands for normal and "l" for logscale. x is for the x-axis and y for the y-axis.


See Also : xsetech X


Author : J.Ph.C.



2.89   xgetmouse get current position of the mouse




CALLING SEQUENCE :

rep=xgetmouse([flag])



PARAMETERS :




DESCRIPTION :

If the mouse is located in the current graphic window xgetmouse returns in rep the current mouse position (x,y) and the value ibutton. The ibutton value indicate the button action at this point if ibutton==-1 then no button clicked if ibutton==0,1 or 2 then the left, middle or right button clicked

If the mouse is not located in the current graphic window xgetmouse waits


EXAMPLE :

xselect();xbasc(); xsetech([0 0 1 1],[0 0 100 100])
xset('alufunction',6)
xtitle(' drawing a rectangle ');
[b,x0,y0]=xclick();rep=[x0,y0,-1];x=x0;y=y0
xrect(x0,y0,x-x0,y-y0);
while rep(3)==-1 then
    rep=xgetmouse(0);
    xrect(x0,y0,x-x0,y0-y);
    x=rep(1);y=rep(2);
    xrect(x0,y0,x-x0,y0-y);
end
xset('alufunction',3)



See Also : locate X, xclick X


Author : S. Steer



2.90   xgrid add a grid on a graphic




CALLING SEQUENCE :

xgrid([style])



PARAMETERS  :




DESCRIPTION :

Adds a grid on a 2D plot. style stands for the dash style or color to use for the grid plotting.


EXAMPLE :

 
plot2d()
xgrid()



See Also : xset X, plot2d X


Author : J.Ph.C..



2.91   xinfo add an info string on a graphic window




CALLING SEQUENCE :

xinfo(string)



PARAMETERS  :




DESCRIPTION :

This function is used to add a sentence on the current graphic window.



2.92   xinit initialisation of a graphic driver




CALLING SEQUENCE :

xinit([driver-name])



PARAMETERS :




DESCRIPTION :

Initialisation of a given driver.

For X-Window driver-name
must be a string which gives the name of a display and this function creates a new graphic window. If the argument is omitted the value of the environment variable DISPLAY is used if it exists or the value 'unix:0.0' is used.

For Postscript or Xfig driver-name
is a name of a file. The graphics operations will be recorded in the specified file.


Author : J.Ph.C.



2.93   xlfont load a font in the graphic context




CALLING SEQUENCE :

xlfont(font-name,font-id)



PARAMETERS :




DESCRIPTION :

This function is used to load an X11 font at different sizes inside the graphic context.


See Also : xset X


REFERENCE :

X11 Font manual.


Author : J.Ph.C..



2.94   xload load a saved graphic




CALLING SEQUENCE :

xload('file-name' [, win-num] ) 



PARAMETERS  :




DESCRIPTION :

This function is used to reload the graphics contained in the file 'file-name' in the graphic-window win-num. The graphics are stored in a binary file in a machine independent way ( using the xdr library).


See Also : xsave X


Author : J.Ph.C..



2.95   xnumb draw numbers on a graphic




CALLING SEQUENCE :

xnumb(x,y,nums,[flag,angle])



PARAMETERS :




DESCRIPTION :

Displays the value of nums[i] using the current number format at position x[i],y[i] in the current scale. if flag is 1 a frame box is added around the strings. if angle is present it's a vector. angle[i] gives the slope in degree (clockwise) to use for the display of the string.


EXAMPLE  :

plot2d([-100,500],[-100,600],[-1,-1],"022");
x=0:100:200;
xnumb(x,500*ones(x),[10,20,35],1);



Author : J.Ph.C.



2.96   xpause suspends Scilab




CALLING SEQUENCE :

xpause(microsecs)



DESCRIPTION :

Synchronises the X11-display and suspends the current process for the number of microseconds specified by the argument. The actual suspension time may be an arbitrary amount longer because of other activity in the system, or because of the time spent in processing the call.


Author : J.Ph.C.



2.97   xpoly draw a single polyline




CALLING SEQUENCE :

[]=xpoly(xv,yv,dtype[,close])



PARAMETERS  :




DESCRIPTION :

draws a single polyline described by (xv,yv). If xv and yv are matrices they are internally considered as a vector using the Fortran internal storage convention. dtype can be "lines" for using the current line style or "marks" for using the current mark to draw the polyline.


EXAMPLE :

 
x=sin(2*%pi*(0:5)/5);
y=cos(2*%pi*(0:5)/5);
plot2d(0,0,-1,"010"," ",[-2,-2,2,2])
xset("dashes",5);
xpoly(x,y,"lines",1);
xset("default");



See Also : xpolys X


Author : J.Ph.C.



2.98   xpolys draw a set of polylines




CALLING SEQUENCE :

[]=xpolys(xpols,ypols,[draw])



PARAMETERS  :




DESCRIPTION :

Draws a set of polyline using marks or dashed lines, each polyline points are store in a column of xpols, ypols. xpols =[ xpol1;xpol2;...] '

The style is given by draw :

If draw(i)
is negative the mark of id -draw(i) is used to draw the polyline i ( marks are draw using the current pattern)

If draw(i)
is strictly positive the line style (or color) of id abs(draw(i)) is used to draw the polyline i.




EXAMPLES :

plot2d(0,0,[-1],"012"," ",[0,0,1,1]);
rand('uniform');
xset('pattern',3)
xpolys(rand(3,5),rand(3,5),[-1,-2,0,1,2])
xset('default')



Author : J.Ph.C.



2.99   xrect draw a rectangle




CALLING SEQUENCE :

[]=xrect(x,y,w,h)



PARAMETERS :




DESCRIPTION :

draws a rectangle [x,y,w,h] (upper-left point, width, height) using current scale and style.


EXAMPLE :

 
plot2d(0,0,-1,"010"," ",[-2,-2,2,2])
xset("pattern",5);
xrect(-1,1,2,2)
xset("default");



Author : J.Ph.C.



2.100   xrects draw or fill a set of rectangles




CALLING SEQUENCE :

[]=xrects(rects,[fill])



PARAMETERS  :




DESCRIPTION :

draws or fills a set of rectangle. each column of rects describes a rectangle ( Upper Left point, width, height)

rects= [ x,y,w,h ; x,y,w,h ;.....] '
fill(n) gives the pattern to use for filling or drawing the rectangle n.

if fill(n)
<0 , the rectangle n is drawn using the line style (or color)-fill(n)

if fill(n)> 0 , the rectangle n is filled using the pattern (or color)fill(n).

if fill(n)= 0
, the rectangle n is drawn using the current line style (or color).


EXAMPLE :

plot2d([-100,500],[-50,50],[-1,-1],"022");
cols=[-34,-33,-32,-20:5:20,32,33,34];
step=20;
x=400*(0:14)/14
step = (x(2)-x(1))/2
rects=[x;10*ones(x);step*ones(x);30*ones(x)];
xrects(rects,cols);
xnumb(x,15*ones(x),cols);



Author : J.Ph.C..



2.101   xrpoly draw a regular polygon




CALLING SEQUENCE :

[]=xrpoly(orig,n,r,[theta])



PARAMETERS  :




DESCRIPTION :

draws a regular polygon of n sides contained in the circle of diameter r and with the origin of the circle set at point orig. theta specifies a rotation angle in radian. This function uses the current graphic scales.



2.102   xs2fig send graphics to a file in Xfig syntax




CALLING SEQUENCE :

xs2fig(win_num,filen [, color])



PARAMETERS :




DESCRIPTION :

This function will send the recorded graphics of the window win_num in the file filen in Xfig syntax This function will work only if the selected driver is "Rec"



2.103   xsave save graphics in a (reloadable) file.




CALLING SEQUENCE :

xsave('file-name' [, win-num] ) 



PARAMETERS  :




DESCRIPTION :

This function is used to save the graphics contained in the graphic-window win-num. The graphics are stored in a binary file in a machine independent way ( using the xdr library) and can be reloaded in Scilab with the xload command.


See Also : xload X


Author : J.Ph.C..



2.104   xsegs draw unconnected segments




CALLING SEQUENCE :

xsegs(nx,ny,[style])



PARAMETERS  :




DESCRIPTION :

this function draws a set of unconnected segments given by nx,ny which are internally considered as vectors ( using the Fortran storage convention). The coordinates of the two points defining a segment are given by two consecutive values of nx and ny.

(nx[i],ny[i])--
>(nx[i+1],nx[i+2])

Using matrices of size (2,.) the segments can be defined by
nx=[ xi_1,xi_
     xf_1,xf_2,...  ]

ny=[ yi_1,yi_2,.....;
    yf_1,yf_2,...  ]
the segments are then (xi_k,yi_k)->(xf_k,yf_k)


EXAMPLE :

x=2*%pi*(0:9)/8;
x1=[sin(x);9*sin(x)];
y1=[cos(x);9*cos(x)];
plot2d([-10,10],[-10,10],[-1,-1],"022");
xset('clipgrf')
xsegs(x1,y1,1:10);
xset('clipoff')



Author : C. J.Ph



2.105   xselect raise the current graphic window




CALLING SEQUENCE :

xselect()



DESCRIPTION :

raises the current graphic window and creates it if necessary. If the current graphic window is iconified nothing is done.


Author : J.Ph.C.



2.106   xset set values of the graphic context




CALLING SEQUENCE :

xset(choice-name,x1,x2,x3,x4,x5)
xset()



PARAMETERS :




DESCRIPTION :

xset is used to set values of the graphic context. When called no arguments, a choice menu is created showing the current values and changes can be performed through toggle buttons


See Also : xget X, colormap X


REFERENCE :

X11 documentation


Author : J.Ph.C.



2.107   xsetech set the sub window of a graphic window to use for graphics




CALLING SEQUENCE :

[]=xsetech(wrect [,frect,logflag])



PARAMETERS :




DESCRIPTION :



This function is mainly used to set the sub window of the graphic window which will be used for graphics. The sub window is specified with the parameter wrect=[x,y,w,h]
( Upper-Left Width Height ). The values in wrect are specified using proportion of the width or height of the current graphic window. for example

wrect=[0,0,1.0,1.0]
means that all the graphic window will be used.

wrect=[0.5,0,0.5,1.0]
means that the graphic region will be the right half of the graphic window.

and can be used in conjunction with graphic routines which request the current graphic scale (for example strf="x0y"
in plot2d ). frect=[xmin,ymin,xmax,ymax] is used to set the graphic scale and is just like the rect argument of plot2d. Its default value is [0,0,1,1].


EXAMPLE :

 
//In this first example xsetech is used to split the graphic window 
//in two parts 

// xsetech is used to fix the first sub window 
// and the graphic scale 
xsetech([0,0,1.0,0.5],[-5,-3,5,3]);
// then we call plot2d with the "001" option to use the graphic scale 
// set by xsetech 
plot2d((1:10)',(1:10)',1,"001",' ');
// xsetech is used to fix the second sub window 
xsetech([0,0.5,1.0,0.5]);
// the graphic scale is set by xsetech to [0,0,1,1] by default 
// and we change it with the use of the rect argument in plot2d 
plot2d((1:10)',(1:10)',1,"011",' ',[-6,-6,6,6]);

//A second example with four graphics on a single graphic window 

xset("font',2,0);
xsetech([0,0,0.5,0.5]);plot3d();
xsetech([0.5,0,0.5,0.5]);plot2d();
xsetech([0.5,0.5,0.5,0.5]);grayplot();
xsetech([0,0.5,0.5,0.5]);histplot();
// back to default values for the sub window 
xsetech([0,0,1,1]);
xset("default');




Author : J.Ph.C.



2.108   xsetm dialog to set values of the graphic context




CALLING SEQUENCE :

xsetm()



DESCRIPTION :

xsetm is used to set values of the graphic context. A choice menu is created showing the current values and changes can be performed through toggle buttons.


See Also : xset X


REFERENCE :

X11 documentation


Author : J.Ph.C.



2.109   xstring display a matrix of strings




CALLING SEQUENCE :

[]=xstring(x,y,str,[angle,flag])



PARAMETERS  :




DESCRIPTION :

draws a matrix of strings ( each line of the matrix stands for a line of text and the line elements are separated by a white space) at location x,y ( lower-left point ) in the current graphic scale. angle if given gives the slope in degree to use for drawing the string. if frame=1 a box is drawn around the string (only if angle=0 )


EXAMPLE  :

plot2d([0;1],[0;1],0)
xstring(0.5,0.5,["Scilab","is" ; "Not","Basilc"])
//Other example
alphabet=['a ','b ','c ','d ','e ','f ','g ',...
          'h ','i ','j ','k ','l ','m ','n ',...
          'o ','p ','q ','r ','s ','t ','u ',...
          'v ', 'w ','x ','y ','z '];

xset('default');              //default graphic parameters
xset("window",1);             //set window number to 1
xclear();                     
plot2d([0;1],[0;2],0);
xstring(0.1,1.8,alphabet)     //alphabet
xstring(0.1,1.6,alphabet,20)  //angle
xset("font",1,1)              //symbol fonts
xstring(0.1,0.1,alphabet)
xset('font',1,3)              //change size font
xstring(0.1,0.3,alphabet)
xset('font',1,24);xstring(0.1,0.6,'a');  //big alpha
xset('default')



Author : J.Ph.C..



2.110   xstringb draw a matrix of strings




CALLING SEQUENCE :

xstringb(x,y,str,w,h,[option])



PARAMETERS :




DESCRIPTION :

plots the matrix of strings str centred inside the rectangle rect=[x,y,w,h] (Down left point , width ,height) in the current graphic scale. If option is given with the value "fill" the character size is computed so as to fill as much as possible of the rectangle.

Enter the command xstringb()
to see a demo.




EXAMPLE :

mat=['Scilab','is';'not','balicS'];
plot2d(0,0,[-1,1],'010',' ',[0,0,1,1]);
r=[0,0,1,0.5];
xstringb(r(1),r(2),mat,r(3),r(4),'fill');
xrect(r(1),r(2)+r(4),r(3),r(4))
r=[r(1),r(2)+r(4)+0.01,r(3),r(4)/2];
xrect(r(1),r(2)+r(4),r(3),r(4))
xstringb(r(1),r(2),mat,r(3),r(4),'fill');
r=[r(1),r(2)+r(4)+0.01,r(3),r(4)/2];
xrect(r(1),r(2)+r(4),r(3),r(4))
xstringb(r(1),r(2),mat,r(3),r(4),'fill');



See Also : xtitle X, titlepage X, xstring X, xstringl X


Author : J.Ph.C.



2.111   xstringl computes bounding box of the display of matrix of strings




CALLING SEQUENCE :

[rect]=xstringl(x,y,str)



PARAMETERS  :




DESCRIPTION :

returns in rect=[x,y,w,h] ( upper-left point, width, height) the size of a rectangle in the current graphic scale. which if drawn would surround the string str drawn at location x,y.


REMARK :

The result can be approximative under the Postscript driver


EXAMPLE :

plot2d([0;1],[0;1])
rect=xstringl(0.5,0.5,["Scilab","is" ; "not","balicS"])



See Also : xstring X


Author : J.Ph.C..



2.112   xtape set up the record process of graphics




CALLING SEQUENCE :

xtape(str,num)



PARAMETERS :




DESCRIPTION :

xtape is used to set up the record process of graphics


Author : J.Ph.C.



2.113   xtitle add titles on a graphic window




CALLING SEQUENCE :

[]=xtitle(xtit,[xax,yax,encad])



PARAMETERS :




DESCRIPTION :

Add titles on a 2D or 3D Scilab plot. xtit stand for a general title , xax for a title on the X-axis and yax for a title on the Y-axis. This function must be called after a call to the high level plotting function (plot2d,plot3d,...). If the arguments are matrices each line of the matrices is displayed on a different line.

Enter the command xtitle()
to see a demo.


Author : J.Ph.C.



2.114   zgrid zgrid plot




CALLING SEQUENCE :

zgrid()  



DESCRIPTION :

plots z-plane grid lines: lines of constant damping factor (zeta) and natural frequency (Wn) are drawn in within the unit Z-plane circle.

Iso-frequency curves are shown in frequency*step on the interval [0,0.5]. Upper limit corresponds to Shannon frequency ( 1/dt
> 2*f ).


See Also : frep2tf X, freson X


Previous Next Contents