3aaaa35b5b9dfa0ad1edb3b766d19d1064339250
[scilab.git] / scilab / modules / graphics / help / en_US / datatips / datatips.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Copyright (C) INRIA -  Serge Steer Serge.Steer@inria.fr
4  *
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  *
7  * This file is hereby licensed under the terms of the GNU GPL v2.0,
8  * pursuant to article 5.3.4 of the CeCILL v.2.1.
9  * This file was originally licensed under the terms of the CeCILL v2.1,
10  * and continues to be available under such terms.
11  * For more information, see the COPYING file which you should have received
12  * along with this program.
13 -->
14 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en_US" xml:id="datatips">
15     <refnamediv>
16         <refname>datatips</refname>
17         <refpurpose>Tool for placing and editing tips along the plotted curves</refpurpose>
18     </refnamediv>
19     <refsection>
20         <title>Description</title>
21         <para>
22             With this tool, it is possible to place, move and modify tips on
23             the curves (polylines). This can be done by program or interactively. The
24             commonly used mode is the interactive one:
25         </para>
26         <para>
27             The datatips mode can be enabled by <link linkend="datatipManagerMode">datatipManagerMode()</link>
28             or using the <literal>Edit/Start datatip manager</literal> or clicking on the
29             toolbar icon
30             <inlinemediaobject>
31                 <imageobject>
32                     <imagedata fileref="../../../../gui/images/icons/16x16/apps/datatips.png"/>
33                 </imageobject>
34             </inlinemediaobject>
35             of the desired graphic window.
36         </para>
37         <para>Once enabled, a simple left click on a curve will add a tip
38             ( a small box with information on the current point) at the
39             interpolated point of the curve.
40         </para>
41         <para>
42             To move a tip, press left button on the small square mark on
43             the curve and drag it to the desired location.
44         </para>
45         <para>
46             To remove a datatip, right click on the small square mark on
47             the curve.
48         </para>
49     </refsection>
50     <refsection>
51         <title>Examples</title>
52         <programlisting role="example"><![CDATA[
53     // this examples show how to manage tips by program
54     x1=linspace(0,1,100)';
55     y1=x1.^3;
56     clf();
57     plot(x1,y1,x1,sinc(10*x1));
58     e=gce();
59     p1=e.children(1);//sinc(10*x1)
60     p2=e.children(2); //x1^3
61     t=datatipCreate(p1,50);
62     datatipSetOrientation(t,"lower right")
63     t=datatipCreate(p1,[0.8 0.5]);
64     t=datatipCreate(p2,[0.1,0.0]);
65     t=datatipCreate(p2,[0.8 0.4]);
66     datatipSetOrientation(t,"upper left")
67
68     function str=myfmt(h)
69         pt = h.data;
70         str = msprintf('sinc\n%s', sci2exp(round(pt*10)/10))
71     endfunction
72     datatipSetDisplay(t,"myfmt")
73
74      ]]></programlisting>
75         <scilab:image>
76             // this examples show how to manage tips by program
77             x1=linspace(0,1,100)';
78             y1=x1.^3;
79             clf();
80             plot(x1,y1,x1,sinc(10*x1));
81             e=gce();
82             p1=e.children(1);//sinc(10*x1)
83             p2=e.children(2); //x1^3
84             t=datatipCreate(p1,50);
85             datatipSetOrientation(t,"lower right")
86             t=datatipCreate(p1,[0.8 0.5]);
87             t=datatipCreate(p2,[0.1,0.0]);
88             t=datatipCreate(p2,[0.8 0.4]);
89             datatipSetOrientation(t,"upper left")
90
91             function str=myfmt(h)
92             pt = h.data;
93             str = msprintf('sinc\n%s', sci2exp(round(pt*10)/10))
94             endfunction
95             datatipSetDisplay(t,"myfmt")
96         </scilab:image>
97         <programlisting role="example"><![CDATA[
98     // With 3D curves
99     x1=linspace(0,1.5,100)';
100     y1=x1.^3;
101     clf();
102     param3d(x1.*cos(10*x1),x1.*sin(10*x1),x1);
103     ax=gca();ax.box='off';
104     ax.rotation_angles=[76 31];
105     p=gce();
106     t=datatipCreate(p,50);
107     datatipSetOrientation(t,"lower right")
108     datatipCreate(p,[0,-1.10,1.10]);
109      ]]></programlisting>
110         <scilab:image>
111             x1=linspace(0,1.5,100)';
112             y1=x1.^3;
113             param3d(x1.*cos(10*x1),x1.*sin(10*x1),x1);
114             ax=gca();ax.box='off';
115             ax.rotation_angles=[76 31];
116             p=gce();
117             t=datatipCreate(p,50);
118             datatipSetOrientation(t,"lower right")
119             datatipCreate(p,[0,-1.10,1.10]);
120         </scilab:image>
121     </refsection>
122     <refsection role="see also">
123         <title>See also</title>
124         <simplelist type="inline">
125             <member>
126                 <link linkend="datatipManagerMode">datatipManagerMode</link>
127             </member>
128             <member>
129                 <link linkend="datatipCreate">datatipCreate</link>
130             </member>
131             <member>
132                 <link linkend="datatipMove">datatipMove</link>
133             </member>
134             <member>
135                 <link linkend="datatipSetDisplay">datatipSetDisplay</link>
136             </member>
137         </simplelist>
138     </refsection>
139 </refentry>