e4078680ffdae59e5c6ab4bb9c4a0c6df97bb9b8
[scilab.git] / scilab / modules / graphics / help / en_US / 2d_plot / contour2di.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) ENPC - Jean-Philippe Chancelier
5  * 
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at    
10  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11  *
12  -->
13 <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" xml:id="contour2di">
14     <refnamediv>
15         <refname>contour2di</refname>
16         <refpurpose>compute level curves of a surface on a 2D plot</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>[xc,yc]=contour2di(x,y,z,nz)</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>x,y</term>
27                 <listitem>
28                     <para>two real row vectors of size n1 and n2: the grid.</para>
29                 </listitem>
30             </varlistentry>
31             <varlistentry>
32                 <term>z</term>
33                 <listitem>
34                     <para>real matrix of size (n1,n2), the values of the function.</para>
35                 </listitem>
36             </varlistentry>
37             <varlistentry>
38                 <term>nz</term>
39                 <listitem>
40                     <para>the level values or the number of levels.</para>
41                     <variablelist>
42                         <varlistentry>
43                             <term/>
44                             <listitem>
45                                 <para>
46                                     If <literal>nz</literal> is an integer, its value gives the number of
47                                     level curves  equally spaced from zmin to zmax as follows:
48                                 </para>
49                                 <programlisting role=""><![CDATA[ 
50 z= zmin + (1:nz)*(zmax-zmin)/(nz+1)
51  ]]></programlisting>
52                                 <para>
53                                     Note that the <literal>zmin</literal> and <literal>zmax</literal> levels are not drawn  (generically they are reduced to points) but they can be added  with 
54                                 </para>
55                                 <programlisting role=""><![CDATA[ 
56 [im,jm] = find(z == zmin);     // or zmax 
57 plot2d(x(im)',y(jm)',-9,"000")
58  ]]></programlisting>
59                             </listitem>
60                         </varlistentry>
61                         <varlistentry>
62                             <term/>
63                             <listitem>
64                                 <para>
65                                     If <literal>nz</literal> is a vector, <literal>nz(i)</literal> gives the value of the ith level curve.
66                                 </para>
67                             </listitem>
68                         </varlistentry>
69                     </variablelist>
70                 </listitem>
71             </varlistentry>
72             <varlistentry>
73                 <term>xc,yc</term>
74                 <listitem>
75                     <para>vectors of identical sizes containing the contours definitions. See below for details.</para>
76                 </listitem>
77             </varlistentry>
78         </variablelist>
79     </refsection>
80     <refsection>
81         <title>Description</title>
82         <para>
83             <literal>contour2di</literal> computes level curves of a surface <literal>z=f(x,y)</literal> on
84             a 2D plot.  The values of <literal>f(x,y)</literal> are given by the matrix <literal>z</literal>
85             at the grid points defined by <literal>x</literal> and <literal>y</literal>.
86         </para>
87         <para>
88             <literal>xc(1)</literal> contains the level associated with first contour path,
89             <literal>yc(1)</literal> contains the number <literal>N1</literal> of points defining this contour path
90             and (<literal>xc(1+(1:N1))</literal>, <literal>yc(1+(1:N1))</literal> ) contain the coordinates
91             of the paths points.
92             The second path begin at <literal>xc(2+N1)</literal> and <literal>yc(2+N1)</literal> and so on.
93         </para>
94     </refsection>
95     <refsection>
96         <title>Examples</title>
97         <programlisting role="example"><![CDATA[ 
98 [xc,yc]=contour2di(1:10,1:10,rand(10,10),5);
99 k=1;n=yc(k);c=1;
100 while k+yc(k)<size(xc,'*')
101   n=yc(k);
102   plot2d(xc(k+(1:n)),yc(k+(1:n)),c)
103   c=c+1;
104   k=k+n+1;
105 end
106  ]]></programlisting>
107     </refsection>
108     <refsection role="see also">
109         <title>See Also</title>
110         <simplelist type="inline">
111             <member>
112                 <link linkend="contour">contour</link>
113             </member>
114             <member>
115                 <link linkend="fcontour">fcontour</link>
116             </member>
117             <member>
118                 <link linkend="fcontour2d">fcontour2d</link>
119             </member>
120             <member>
121                 <link linkend="contour2d">contour2d</link>
122             </member>
123             <member>
124                 <link linkend="plot2d">plot2d</link>
125             </member>
126             <member>
127                 <link linkend="xset">xset</link>
128             </member>
129         </simplelist>
130     </refsection>
131 </refentry>