1ff5ceb9dbc1c7208f54702e3fe9cd2a6cd52a0a
[scilab.git] / scilab / modules / graphics / help / pt_BR / 2d_plot / contourf.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  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="contourf" xml:lang="en">
17     <refnamediv>
18         <refname>contourf</refname>
19         <refpurpose>Curvas de nível preenchidas de uma superfície em um esboço
20             2d
21         </refpurpose>
22     </refnamediv>
23     <refsynopsisdiv>
24         <title>Seqüência de Chamamento</title>
25         <synopsis>contourf(x,y,z,nz,[style,strf,leg,rect,nax])</synopsis>
26     </refsynopsisdiv>
27     <refsection>
28         <title>Parâmetrtos</title>
29         <variablelist>
30             <varlistentry>
31                 <term>x,y</term>
32                 <listitem>
33                     <para>dois vetores de reais de tamanhos n1 e n2 definindo o grid.
34                     </para>
35                 </listitem>
36             </varlistentry>
37             <varlistentry>
38                 <term>z</term>
39                 <listitem>
40                     <para>matriz de reais de tamanho (n1,n2), os valores da função.
41                     </para>
42                 </listitem>
43             </varlistentry>
44             <varlistentry>
45                 <term>nz</term>
46                 <listitem>
47                     <para>os valores de nível ou o número de níveis.</para>
48                     <variablelist>
49                         <varlistentry>
50                             <term>-</term>
51                             <listitem>
52                                 <para>
53                                     Se <literal>nz</literal> for um inteiro, seu valor
54                                     fornece o número de níveis igualmente espaçados de zmin a zmax
55                                     como segue:
56                                 </para>
57                                 <programlisting role=""><![CDATA[ 
58 z= zmin + (1:nz)*(zmax-zmin)/(nz+1)
59  ]]></programlisting>
60                                 <para>
61                                     Note que os níveis <literal>zmin</literal> e
62                                     <literal>zmax</literal> não são desenhados (genericamente eles
63                                     são reduzidos a pontos) mas podem ser adicionados através de
64                                 </para>
65                                 <programlisting role=""><![CDATA[ 
66 [im,jm] = find(z == zmin);     // ou zmax 
67 plot2d(x(im)',y(jm)',-9,"000")
68  ]]></programlisting>
69                             </listitem>
70                         </varlistentry>
71                         <varlistentry>
72                             <term>-</term>
73                             <listitem>
74                                 <para>
75                                     Se <literal>nz</literal> for um vetor,
76                                     <literal>nz(i)</literal> fornece o valor da i-ésima curva de
77                                     nível.
78                                 </para>
79                             </listitem>
80                         </varlistentry>
81                     </variablelist>
82                 </listitem>
83             </varlistentry>
84             <varlistentry>
85                 <term>style,strf,leg,rect,nax</term>
86                 <listitem>
87                     <para>
88                         ver <literal>plot2d</literal>. O argumento
89                         <literal>style</literal> fornece as cores a serem utilizadas pelas
90                         curvas de nível. Deve ter o mesmo tamanho que o número de
91                         níveis.
92                     </para>
93                 </listitem>
94             </varlistentry>
95         </variablelist>
96     </refsection>
97     <refsection>
98         <title>Descrição</title>
99         <para>
100             <literal>contourf</literal> pinta a superfície entre duas curvas de
101             nível consecutivas <literal>z=f(x,y)</literal> em um esboço 2d. Os valores
102             de <literal>f(x,y)</literal> são fornecidos pela matriz
103             <literal>z</literal> nos pontos de grid definidos por <literal>x</literal>
104             e <literal>y</literal>.
105         </para>
106         <para>Você pode mudar o formato dos pontos flutuantes impressos sobre os
107             níveis utilizando <literal>xset("fpf",string)</literal> onde
108             <literal>string</literal> fornece o formato em sintaxe de formato C ( por
109             exemplo <literal>string="%.3f"</literal>). Use
110             <literal>string=""</literal> para voltar ao formato padrão.
111         </para>
112         <para>
113             Entre com o comando <literal>contourf()</literal> para visualizar
114             uma demonstração.
115         </para>
116     </refsection>
117     <refsection>
118         <title>Exemplos</title>
119         <programlisting role="example"><![CDATA[ 
120 contourf(1:10,1:10,rand(10,10),5,1:5,"011"," ",[0,0,11,11])
121
122 function z=peaks(x,y)
123 x1=x(:).*.ones(1,size(y,'*'));
124 y1=y(:)'.*.ones(size(x,'*'),1);
125 z =  (3*(1-x1).^2).*exp(-(x1.^2) - (y1+1).^2) ... 
126    - 10*(x1/5 - x1.^3 - y1.^5).*exp(-x1.^2-y1.^2) ... 
127    - 1/3*exp(-(x1+1).^2 - y1.^2) 
128 endfunction
129
130 function z=peakit()
131 x=-4:0.1:4;y=x;z=peaks(x,y);
132 endfunction
133
134 z=peakit();
135
136 levels=[-6:-1,-logspace(-5,0,10),logspace(-5,0,10),1:8];
137 m=size(levels,'*');
138 n = fix(3/8*m);
139 r = [(1:n)'/n; ones(m-n,1)];
140 g = [zeros(n,1); (1:n)'/n; ones(m-2*n,1)];
141 b = [zeros(2*n,1); (1:m-2*n)'/(m-2*n)];
142 h = [r g b];
143 xset('colormap',h);
144 xset('fpf',' ');
145 clf();
146 contourf([],[],z,[-6:-1,-logspace(-5,0,10),logspace(-5,0,10),1:8],0*ones(1,m))
147
148 xset('fpf','');
149 clf();
150 contourf([],[],z,[-6:-1,-logspace(-5,0,10),logspace(-5,0,10),1:8]);
151  ]]></programlisting>
152     </refsection>
153     <refsection>
154         <title>Ver Também</title>
155         <simplelist type="inline">
156             <member>
157                 <link linkend="contour">contour</link>
158             </member>
159             <member>
160                 <link linkend="fcontour">fcontour</link>
161             </member>
162             <member>
163                 <link linkend="fcontour2d">fcontour2d</link>
164             </member>
165             <member>
166                 <link linkend="contour2di">contour2di</link>
167             </member>
168             <member>
169                 <link linkend="plot2d">plot2d</link>
170             </member>
171             <member>
172                 <link linkend="xset">xset</link>
173             </member>
174         </simplelist>
175     </refsection>
176 </refentry>