~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/graphics/help/en_US/2d_plot/fec.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 *
12
12
 -->
13
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" version="5.0-subset Scilab" xml:lang="en" xml:id="fec">
14
 
  <refnamediv>
15
 
    <refname>fec</refname>
16
 
    <refpurpose> pseudo-color plot of a function defined on a triangular mesh</refpurpose>
17
 
  </refnamediv>
18
 
  <refsynopsisdiv>
19
 
    <title>Calling Sequence</title>
20
 
    <synopsis>fec(x,y,triangles,func,&lt;opt_args&gt;)
21
 
      fec(x,y,triangles,func,[strf,leg,rect,nax,zminmax,colminmax,colout,mesh])
22
 
    </synopsis>
23
 
  </refsynopsisdiv>
24
 
  <refsection>
25
 
    <title>Arguments</title>
26
 
    <variablelist>
27
 
      <varlistentry>
28
 
        <term>x,y</term>
29
 
        <listitem>
30
 
          <para>
31
 
            two vectors of size <literal>n</literal>, <literal>(x(i),y(i))</literal> gives the coordinates of 
32
 
            node  <literal>i</literal>
33
 
          </para>
34
 
        </listitem>
35
 
      </varlistentry>
36
 
      <varlistentry>
37
 
        <term>func</term>
38
 
        <listitem>
39
 
          <para>
40
 
            a vector of size <literal>n</literal> : <literal>func(i)</literal> gives the value at node <literal>i</literal>
41
 
            of the function for which we want the pseudo-color plot.
42
 
          </para>
43
 
        </listitem>
44
 
      </varlistentry>
45
 
      <varlistentry>
46
 
        <term>triangles</term>
47
 
        <listitem>
48
 
          <para>
49
 
            is a <literal>[Ntr,5]</literal> matrix. Each line of <literal>triangles</literal> specifies a triangle 
50
 
            of the  mesh <literal>triangle(j) = [number,node1,node2,node3,flag]</literal>. 
51
 
            <literal>node1,node2,node3</literal> are the number of the nodes which constitutes 
52
 
            the triangle. number is the number of the triangle and flag is an integer 
53
 
            not used in the fec function
54
 
          </para>
55
 
        </listitem>
56
 
      </varlistentry>
57
 
      <varlistentry>
58
 
        <term>&lt;opt_args&gt;</term>
59
 
        <listitem>
60
 
          <para>
61
 
            This represents a sequence of statements <literal>key1=value1, key2=value2</literal>,... where <literal>key1</literal>,
62
 
            <literal>key2,...</literal> can be one of the following: strf, leg, rect, nax, zminmax, colminmax, colout, mesh
63
 
            (see <link linkend="plot2d">plot2d</link> for the 4 first ones).
64
 
          </para>
65
 
        </listitem>
66
 
      </varlistentry>
67
 
      <varlistentry>
68
 
        <term>strf,leg,rect,nax</term>
69
 
        <listitem>
70
 
          <para>see plot2d</para>
71
 
        </listitem>
72
 
      </varlistentry>
73
 
      <varlistentry>
74
 
        <term>zminmax</term>
75
 
        <listitem>
76
 
          <para>vector with 2 components [zmin zmax] (useful in particular for animation)</para>
77
 
        </listitem>
78
 
      </varlistentry>
79
 
      <varlistentry>
80
 
        <term>colminmax</term>
81
 
        <listitem>
82
 
          <para>vector of 2 positives integers [colmin colmax]</para>
83
 
        </listitem>
84
 
      </varlistentry>
85
 
      <varlistentry>
86
 
        <term>colout</term>
87
 
        <listitem>
88
 
          <para>vector of 2 integers [under_min_col upper_max_col]</para>
89
 
        </listitem>
90
 
      </varlistentry>
91
 
      <varlistentry>
92
 
        <term>mesh</term>
93
 
        <listitem>
94
 
          <para>boolean scalar, default value %f (must be true if you want also display the mesh)</para>
95
 
        </listitem>
96
 
      </varlistentry>
97
 
    </variablelist>
98
 
  </refsection>
99
 
  <refsection>
100
 
    <title>Description</title>
101
 
    <para>This function is the good one to draw linear triangular finite element solutions 
102
 
      or simply to display a function defined on a triangulation. The color interpolation
103
 
      is done through software computation and so it is not too fast.
104
 
    </para>
105
 
    <para>
106
 
      The function <link linkend="colorbar">colorbar</link> may be used to see the color scale (see the example
107
 
      section).
108
 
    </para>
109
 
    <para>    
110
 
      The <literal>zminmax</literal> argument gives the z values associated with the first and the last 
111
 
      color (of the current colormap). More exactly if the colormap have nc colors and if we note 
112
 
      <emphasis>dz = (zmax-zmin)/nc</emphasis>, then the part of the triangulation where  
113
 
      <emphasis>zmin + (i-1)dz &lt;= z &lt; zmin + i dz</emphasis> is filled with the color <emphasis>i</emphasis>). 
114
 
      By default <emphasis>zmin = min(func)</emphasis> and <emphasis>zmax = max(func)</emphasis>. If you want to do 
115
 
      an animation with func values that varie in time, take for zmin and zmax the global 
116
 
      minimum and maximum or something close.
117
 
    </para>
118
 
    <para>
119
 
      The <literal>colout</literal> argument lets the user choosing the colors for the 2 extremes
120
 
      regions <emphasis>{func &lt; zmin}</emphasis> and <emphasis>{func &gt; zmax}</emphasis>, <literal>under_min_col</literal> and 
121
 
      <literal>upper_max_col</literal> may be equal (independantly) to:
122
 
    </para>
123
 
    <variablelist>
124
 
      <varlistentry>
125
 
        <term>-1</term>
126
 
        <listitem>
127
 
          <para>in this case the same color than in the neighbouring zone is used (CAUTION: 
128
 
            you do not see that the corresponding limit is crossed), this is the
129
 
            default case.
130
 
          </para>
131
 
        </listitem>
132
 
      </varlistentry>
133
 
      <varlistentry>
134
 
        <term>0</term>
135
 
        <listitem>
136
 
          <para>in this case the extreme region is not painting at all.</para>
137
 
        </listitem>
138
 
      </varlistentry>
139
 
      <varlistentry>
140
 
        <term>k</term>
141
 
        <listitem>
142
 
          <para>(k being a valid index to a color of the current colormap) the extreme region
143
 
            is painting in color k.
144
 
          </para>
145
 
        </listitem>
146
 
      </varlistentry>
147
 
    </variablelist>
148
 
    <para>
149
 
      If you do not want to use the complete colormap you may use the <literal>colminmax</literal>
150
 
      argument with <emphasis>1 &lt;= colmin &lt; colmax &lt;= nc</emphasis> (nc being the number of colors 
151
 
      of the current colormap) so as to use only the [colmin,colmax]  sub-part of the colormap.
152
 
      (by default all the colors of the colormap are used).
153
 
    </para>
154
 
    <para>
155
 
      See the demo files <literal>demos/fec</literal>:
156
 
    </para>
157
 
    <para>
158
 
      <literal>fec.ex1</literal> is a simple demo file in which a mesh and a function 
159
 
      on that mesh is completely built in Scilab syntax
160
 
    </para>
161
 
    <para>
162
 
      <literal>fec.ex2</literal> is an example for which the mesh and the function value where 
163
 
      computed by an external mesh builder (amdba type mesh) and an external program.
164
 
      A set of macros ( provided in file <literal>macros.sci</literal>) can be used to read the 
165
 
      data files in Scilab and plot the results.
166
 
    </para>
167
 
  </refsection>
168
 
  <refsection>
169
 
    <title>Sample</title>
170
 
    <scilab:image>fec();</scilab:image>
171
 
  </refsection>
172
 
  <refsection>
173
 
    <title>Examples</title>
174
 
    <programlisting role="example"><![CDATA[ 
 
14
    <refnamediv>
 
15
        <refname>fec</refname>
 
16
        <refpurpose> pseudo-color plot of a function defined on a triangular mesh</refpurpose>
 
17
    </refnamediv>
 
18
    <refsynopsisdiv>
 
19
        <title>Calling Sequence</title>
 
20
        <synopsis>fec(x,y,triangles,func,&lt;opt_args&gt;)
 
21
            fec(x,y,triangles,func,[strf,leg,rect,nax,zminmax,colminmax,colout,mesh])
 
22
        </synopsis>
 
23
    </refsynopsisdiv>
 
24
    <refsection>
 
25
        <title>Arguments</title>
 
26
        <variablelist>
 
27
            <varlistentry>
 
28
                <term>x,y</term>
 
29
                <listitem>
 
30
                    <para>
 
31
                        two vectors of size <literal>n</literal>, <literal>(x(i),y(i))</literal> gives the coordinates of 
 
32
                        node  <literal>i</literal>
 
33
                    </para>
 
34
                </listitem>
 
35
            </varlistentry>
 
36
            <varlistentry>
 
37
                <term>func</term>
 
38
                <listitem>
 
39
                    <para>
 
40
                        a vector of size <literal>n</literal> : <literal>func(i)</literal> gives the value at node <literal>i</literal>
 
41
                        of the function for which we want the pseudo-color plot.
 
42
                    </para>
 
43
                </listitem>
 
44
            </varlistentry>
 
45
            <varlistentry>
 
46
                <term>triangles</term>
 
47
                <listitem>
 
48
                    <para>
 
49
                        is a <literal>[Ntr,5]</literal> matrix. Each line of <literal>triangles</literal> specifies a triangle 
 
50
                        of the  mesh <literal>triangle(j) = [number,node1,node2,node3,flag]</literal>. 
 
51
                        <literal>node1,node2,node3</literal> are the number of the nodes which constitutes 
 
52
                        the triangle. number is the number of the triangle and flag is an integer 
 
53
                        not used in the fec function
 
54
                    </para>
 
55
                </listitem>
 
56
            </varlistentry>
 
57
            <varlistentry>
 
58
                <term>&lt;opt_args&gt;</term>
 
59
                <listitem>
 
60
                    <para>
 
61
                        This represents a sequence of statements <literal>key1=value1, key2=value2</literal>,... where <literal>key1</literal>,
 
62
                        <literal>key2,...</literal> can be one of the following: strf, leg, rect, nax, zminmax, colminmax, colout, mesh
 
63
                        (see <link linkend="plot2d">plot2d</link> for the 4 first ones).
 
64
                    </para>
 
65
                </listitem>
 
66
            </varlistentry>
 
67
            <varlistentry>
 
68
                <term>strf,leg,rect,nax</term>
 
69
                <listitem>
 
70
                    <para>see plot2d</para>
 
71
                </listitem>
 
72
            </varlistentry>
 
73
            <varlistentry>
 
74
                <term>zminmax</term>
 
75
                <listitem>
 
76
                    <para>vector with 2 components [zmin zmax] (useful in particular for animation)</para>
 
77
                </listitem>
 
78
            </varlistentry>
 
79
            <varlistentry>
 
80
                <term>colminmax</term>
 
81
                <listitem>
 
82
                    <para>vector of 2 positives integers [colmin colmax]</para>
 
83
                </listitem>
 
84
            </varlistentry>
 
85
            <varlistentry>
 
86
                <term>colout</term>
 
87
                <listitem>
 
88
                    <para>vector of 2 integers [under_min_col upper_max_col]</para>
 
89
                </listitem>
 
90
            </varlistentry>
 
91
            <varlistentry>
 
92
                <term>mesh</term>
 
93
                <listitem>
 
94
                    <para>boolean scalar, default value %f (must be true if you want also display the mesh)</para>
 
95
                </listitem>
 
96
            </varlistentry>
 
97
        </variablelist>
 
98
    </refsection>
 
99
    <refsection>
 
100
        <title>Description</title>
 
101
        <para>This function is the good one to draw linear triangular finite element solutions 
 
102
            or simply to display a function defined on a triangulation. The color interpolation
 
103
            is done through software computation and so it is not too fast.
 
104
        </para>
 
105
        <para>
 
106
            The function <link linkend="colorbar">colorbar</link> may be used to see the color scale (see the example
 
107
            section).
 
108
        </para>
 
109
        <para>    
 
110
            The <literal>zminmax</literal> argument gives the z values associated with the first and the last 
 
111
            color (of the current colormap). More exactly if the colormap have nc colors and if we note 
 
112
            <emphasis>dz = (zmax-zmin)/nc</emphasis>, then the part of the triangulation where  
 
113
            <emphasis>zmin + (i-1)dz &lt;= z &lt; zmin + i dz</emphasis> is filled with the color <emphasis>i</emphasis>). 
 
114
            By default <emphasis>zmin = min(func)</emphasis> and <emphasis>zmax = max(func)</emphasis>. If you want to do 
 
115
            an animation with func values that varie in time, take for zmin and zmax the global 
 
116
            minimum and maximum or something close.
 
117
        </para>
 
118
        <para>
 
119
            The <literal>colout</literal> argument lets the user choosing the colors for the 2 extremes
 
120
            regions <emphasis>{func &lt; zmin}</emphasis> and <emphasis>{func &gt; zmax}</emphasis>, <literal>under_min_col</literal> and 
 
121
            <literal>upper_max_col</literal> may be equal (independantly) to:
 
122
        </para>
 
123
        <variablelist>
 
124
            <varlistentry>
 
125
                <term>-1</term>
 
126
                <listitem>
 
127
                    <para>in this case the same color than in the neighbouring zone is used (CAUTION: 
 
128
                        you do not see that the corresponding limit is crossed), this is the
 
129
                        default case.
 
130
                    </para>
 
131
                </listitem>
 
132
            </varlistentry>
 
133
            <varlistentry>
 
134
                <term>0</term>
 
135
                <listitem>
 
136
                    <para>in this case the extreme region is not painting at all.</para>
 
137
                </listitem>
 
138
            </varlistentry>
 
139
            <varlistentry>
 
140
                <term>k</term>
 
141
                <listitem>
 
142
                    <para>(k being a valid index to a color of the current colormap) the extreme region
 
143
                        is painting in color k.
 
144
                    </para>
 
145
                </listitem>
 
146
            </varlistentry>
 
147
        </variablelist>
 
148
        <para>
 
149
            If you do not want to use the complete colormap you may use the <literal>colminmax</literal>
 
150
            argument with <emphasis>1 &lt;= colmin &lt; colmax &lt;= nc</emphasis> (nc being the number of colors 
 
151
            of the current colormap) so as to use only the [colmin,colmax]  sub-part of the colormap.
 
152
            (by default all the colors of the colormap are used).
 
153
        </para>
 
154
        <para>
 
155
            See the demo files <literal>demos/fec</literal>:
 
156
        </para>
 
157
        <para>
 
158
            <literal>fec.ex1</literal> is a simple demo file in which a mesh and a function 
 
159
            on that mesh is completely built in Scilab syntax
 
160
        </para>
 
161
        <para>
 
162
            <literal>fec.ex2</literal> is an example for which the mesh and the function value where 
 
163
            computed by an external mesh builder (amdba type mesh) and an external program.
 
164
            A set of macros ( provided in file <literal>macros.sci</literal>) can be used to read the 
 
165
            data files in Scilab and plot the results.
 
166
        </para>
 
167
    </refsection>
 
168
    <refsection>
 
169
        <title>Sample</title>
 
170
        <scilab:image>fec();</scilab:image>
 
171
    </refsection>
 
172
    <refsection>
 
173
        <title>Examples</title>
 
174
        <programlisting role="example"><![CDATA[ 
175
175
// define a mini triangulation (4 vertices, 2 triangles)
176
176
x = [0 1 0 -1];
177
177
y = [0 0 1  1];
190
190
  xtitle("fec example (without the mesh)")
191
191
show_window()
192
192
 ]]></programlisting>
193
 
    <programlisting role="example"><![CDATA[ 
 
193
        <programlisting role="example"><![CDATA[ 
194
194
// define a mini triangulation (4 vertices, 2 triangles)
195
195
x = [0 1 0 -1];
196
196
y = [0 0 1  1];
206
206
xtitle("fec example : using zminmax argument")
207
207
show_window()
208
208
 ]]></programlisting>
209
 
    <programlisting role="example"><![CDATA[ 
 
209
        <programlisting role="example"><![CDATA[ 
210
210
// define a mini triangulation (4 vertices, 2 triangles)
211
211
x = [0 1 0 -1];
212
212
y = [0 0 1  1];
235
235
  xtitle("fec example : using zminmax and colout =[0 -1]")
236
236
show_window()
237
237
 ]]></programlisting>
238
 
    <programlisting role="example"><![CDATA[ 
 
238
        <programlisting role="example"><![CDATA[ 
239
239
// define a mini triangulation (4 vertices, 2 triangles)
240
240
x = [0 1 0 -1];
241
241
y = [0 0 1  1];
258
258
  xtitle("fec using the jet colormap")
259
259
show_window()
260
260
 ]]></programlisting>
261
 
  </refsection>
262
 
  <refsection role="see also">
263
 
    <title>See Also</title>
264
 
    <simplelist type="inline">
265
 
      <member>
266
 
        <link linkend="colorbar">colorbar</link>
267
 
      </member>
268
 
      <member>
269
 
        <link linkend="Sfgrayplot">Sfgrayplot</link>
270
 
      </member>
271
 
      <member>
272
 
        <link linkend="Sgrayplot">Sgrayplot</link>
273
 
      </member>
274
 
    </simplelist>
275
 
  </refsection>
 
261
    </refsection>
 
262
    <refsection role="see also">
 
263
        <title>See Also</title>
 
264
        <simplelist type="inline">
 
265
            <member>
 
266
                <link linkend="colorbar">colorbar</link>
 
267
            </member>
 
268
            <member>
 
269
                <link linkend="Sfgrayplot">Sfgrayplot</link>
 
270
            </member>
 
271
            <member>
 
272
                <link linkend="Sgrayplot">Sgrayplot</link>
 
273
            </member>
 
274
        </simplelist>
 
275
    </refsection>
276
276
</refentry>