Creating plots

Example

scf(); //create figure
// clf(); to clear figure
//d efinition of the x-axis and the y values
x= [0: (%pi/20): 2*%pi];
y=sin(x);
//plot the data
plot(x,y);
plot(x,sin) // ... does the same
plot(x,2*y); // will be plotted in the same figure
// xdel(); to close figure

Managing a figure

At first a graphic figure should be prepared. It is possible to clear an existing figure or to generate a new one.

Launch the following commands :

num = 1234;
scf(num) // create figure with number num or set figure num to the current figure
clf(num) // clear figure num
xdel(num)  // closes grafic windows num

All plotting action will be done in the currend figure. The variable num can be leaved out, to address the current figure (e.g. clf()).

public: howto/do a plot (last edited 2011-03-31 15:40:04 by simon.gareste@scilab.org)