1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2011 - INRIA - Serge Steer <serge.steer@inria.fr>
4 // This file must be used under the terms of the CeCILL.
5 // This source file is licensed as described in the file COPYING, which
6 // you should have received as part of this distribution. The terms
7 // are also available at;
8 // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
12 my_handle = scf(100001);
13 clf(my_handle,"reset");
14 fig=gcf();fig.axes_size=[760 460];
16 title(_("datatips on 2D curves"),"fontsize",3);
18 x1=linspace(-1,1,300)';
19 plot(x1,x1.^3,x1,sinc(10*x1));
21 p1=e.children(1);//the handle on the sinc(10*x1) curve
22 p2=e.children(2); //the handle on the x1^3 curve
24 //Create 2 datatips on the sinc curve
25 datatipCreate(p1,50); //by index
26 datatipCreate(p1,[0.8 0.5]);//by nearest mesh point
28 //Create 2 datatips on the x^3 curve
29 datatipSetStyle(p2,2,%f) //directional arrow no box
30 function s=mydisp(curve,pt,index),s=msprintf("%.2g",pt(1)),endfunction
31 datatipSetDisplay(p2,mydisp) // Change the default datatip label
32 datatipCreate(p2,[0.1,0]);
33 datatipCreate(p2,[0.8 0.4]);
35 datatipManagerMode(gcf(),"on") //activate the interactive editor
38 demo_viewCode("datatip1.sce");