Interactive graphics is easy in Scilab

Interactive graphics are very easy to create in Scilab. For example, to interactively change with a slider the coefficient a in the graph of x\rightarrow \sin(ax) you only need the following lines:

clf
x=linspace(0,2*%pi,512);
graph=plot(x,sin(x));
h=uicontrol("style","slider","units","normalized",...
  "position",[0 0 0.05 1],...
  "min",1,"max",10,...
  "callback","graph.data(:,2)=sin(h.value*x)");

Here is a small video showing how you can play with the slider:

2 Likes