8b832e5ca627b137712c60a59dbca07d22f23580
[scilab.git] / scilab / modules / graphics / help / pt_BR / 2d_plot / Sfgrayplot.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
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="Sfgrayplot" xml:lang="en">
17     <refnamediv>
18         <refname>Sfgrayplot</refname>
19         <refpurpose>esboço 2d suave de uma superfície definida por uma função
20             utilizando cores 
21         </refpurpose>
22     </refnamediv>
23     <refsynopsisdiv>
24         <title>Seqüência de Chamamento</title>
25         <synopsis>Sfgrayplot(x,y,f,&lt;opt_args&gt;)
26             Sfgrayplot(x,y,f [,strf, rect, nax, zminmax, colminmax, mesh, colout])
27         </synopsis>
28     </refsynopsisdiv>
29     <refsection>
30         <title>Parâmetros</title>
31         <variablelist>
32             <varlistentry>
33                 <term>x,y</term>
34                 <listitem>
35                     <para>vetores linhas de reais de tamanhos n1 e n2. </para>
36                 </listitem>
37             </varlistentry>
38             <varlistentry>
39                 <term>f</term>
40                 <listitem>
41                     <para>função do Scilab (z=f(x,y)) </para>
42                 </listitem>
43             </varlistentry>
44             <varlistentry>
45                 <term>&lt;opt_args&gt;</term>
46                 <listitem>
47                     <para>
48                         representa uma seqüência de declarações <literal>key1=value1,
49                             key2=value2
50                         </literal>
51                         ,... onde <literal>key1</literal>,
52                         <literal>key2,...</literal> podem ser um dos seguintes: strf, rect,
53                         nax, zminmax, colminmax, mesh, colout (ver <link linkend="plot2d">plot2d</link> para os três primeiros e <link linkend="fec">fec</link> para os quatro últimos).
54                     </para>
55                 </listitem>
56             </varlistentry>
57             <varlistentry>
58                 <term>strf,rect,nax</term>
59                 <listitem>
60                     <para>
61                         ver <link linkend="plot2d">plot2d</link>.
62                     </para>
63                 </listitem>
64             </varlistentry>
65             <varlistentry>
66                 <term>zminmax, colminmax, mesh, colout</term>
67                 <listitem>
68                     <para>
69                         ver <link linkend="fec">fec</link>.
70                     </para>
71                 </listitem>
72             </varlistentry>
73         </variablelist>
74     </refsection>
75     <refsection>
76         <title>Descrição</title>
77         <para>
78             <literal>Sfgrayplot</literal> é o mesmo que
79             <literal>fgrayplot</literal> mas o esboço é suavizado. A função
80             <literal>fec</literal> é utilizada para suavização. A superfície é
81             esboçada assumindo-se que é linear em um conjunto de triângulos
82             construídos a partir do grid (aqui, com n1=5, n2=3):
83         </para>
84         <screen><![CDATA[ 
85 _____________
86 | /| /| /| /|
87 |/_|/_|/_|/_| 
88 | /| /| /| /| 
89 |/_|/_|/_|/_|
90  ]]></screen>
91         <para>
92             A função <link linkend="colorbar">colorbar</link> pode ser utilizada
93             para se visualizar a escala de cores (mas você deve saber (ou computar) os
94             valores mínimo e máximo).
95         </para>
96         <para>
97             Ao invés de Sfgrayplot, você pode usar <link linkend="Sgrayplot">Sgrayplot</link> este pode ser um pouco mais
98             rápido.
99         </para>
100         <para>
101             Entre com o comando <literal>Sfgrayplot()</literal> para visualizar
102             uma demonstração.
103         </para>
104     </refsection>
105     <refsection>
106         <title>Exemplos</title>
107         <programlisting role="example"><![CDATA[ 
108 // exemplo #1: esboço de 4 superfícies
109 function z=surf1(x,y), z=x*y, endfunction
110 function z=surf2(x,y), z=x^2-y^2, endfunction
111 function z=surf3(x,y), z=x^3+y^2, endfunction
112 function z=surf4(x,y), z=x^2+y^2, endfunction
113 clf()
114 set(gcf(),"color_map",[jetcolormap(64);hotcolormap(64)])
115 x = linspace(-1,1,60);
116 y = linspace(-1,1,60);
117 drawlater();
118 subplot(2,2,1)
119    colorbar(-1,1,[1,64])
120    Sfgrayplot(x,y,surf1,strf="041",colminmax=[1,64])
121    xtitle("f(x,y) = x*y")
122 subplot(2,2,2)
123    colorbar(-1,1,[65,128])
124    Sfgrayplot(x,y,surf2,strf="041",colminmax=[65,128])
125    xtitle("f(x,y) = x^2-y^2")
126 subplot(2,2,3)
127    colorbar(-1,2,[65,128])
128    Sfgrayplot(x,y,surf3,strf="041",colminmax=[65,128])
129    xtitle("f(x,y) = x^3+y^2")
130 subplot(2,2,4)
131    colorbar(0,2,[1,64])
132    Sfgrayplot(x,y,surf4,strf="041",colminmax=[1,64])
133    xtitle("f(x,y) = x^2+y^2")
134 drawnow();
135 show_window()
136  ]]></programlisting>
137         <scilab:image>
138             function z=surf1(x,y), z=x*y, endfunction
139             function z=surf2(x,y), z=x^2-y^2, endfunction
140             function z=surf3(x,y), z=x^3+y^2, endfunction
141             function z=surf4(x,y), z=x^2+y^2, endfunction
142             clf()
143             set(gcf(),"color_map",[jetcolormap(64);hotcolormap(64)])
144             x = linspace(-1,1,60);
145             y = linspace(-1,1,60);
146             drawlater();
147             subplot(2,2,1)
148             colorbar(-1,1,[1,64])
149             Sfgrayplot(x,y,surf1,strf="041",colminmax=[1,64])
150             xtitle("f(x,y) = x*y")
151             subplot(2,2,2)
152             colorbar(-1,1,[65,128])
153             Sfgrayplot(x,y,surf2,strf="041",colminmax=[65,128])
154             xtitle("f(x,y) = x^2-y^2")
155             subplot(2,2,3)
156             colorbar(-1,2,[65,128])
157             Sfgrayplot(x,y,surf3,strf="041",colminmax=[65,128])
158             xtitle("f(x,y) = x^3+y^2")
159             subplot(2,2,4)
160             colorbar(0,2,[1,64])
161             Sfgrayplot(x,y,surf4,strf="041",colminmax=[1,64])
162             xtitle("f(x,y) = x^2+y^2")
163             drawnow();
164         </scilab:image>
165         <programlisting role="example"><![CDATA[
166 // exemplo #2: esboço de surf3 e adição de algumas linhas de contorno
167 function z=surf3(x,y), z=x^3+y^2, endfunction
168 clf()
169 x = linspace(-1,1,60);
170 y = linspace(-1,1,60);
171 set(gcf(),"color_map",hotcolormap(128))
172 drawlater();
173 colorbar(-1,2)
174 Sfgrayplot(x,y,surf3,strf="041")
175 fcontour2d(x,y,surf3,[-0.1, 0.025, 0.4],style=[1 1 1],strf="000")
176 xtitle("f(x,y) = x^3+y^2")
177 drawnow();
178 show_window()
179  ]]></programlisting>
180         <scilab:image>
181             function z=surf3(x,y), z=x^3+y^2, endfunction
182             clf()
183             x = linspace(-1,1,60);
184             y = linspace(-1,1,60);
185             set(gcf(),"color_map",hotcolormap(128))
186             drawlater();
187             colorbar(-1,2)
188             Sfgrayplot(x,y,surf3,strf="041")
189             contour2d(x,y,surf3,[-0.1, 0.025, 0.4],style=[1 1 1],strf="000")
190             xtitle("f(x,y) = x^3+y^2")
191             drawnow() ;
192             show_window()
193         </scilab:image>
194         <programlisting role="example"><![CDATA[
195 // exemplo #3: esboço de surf3 e uso dos argumentos opcionais zminmax e colout
196 //             para restringir o esboço em -0.5&lt;= z &lt;= 1
197 function z=surf3(x,y), z=x^3+y^2, endfunction
198 clf()
199 x = linspace(-1,1,60);
200 y = linspace(-1,1,60);
201 set(gcf(),"color_map",jetcolormap(128))
202 drawlater();
203 zminmax = [-0.5 1]; colors=[32 96];
204 colorbar(zminmax(1),zminmax(2),colors)
205 Sfgrayplot(x, y, surf3, strf="041", zminmax=zminmax, colout=[0 0], colminmax=colors)
206 fcontour2d(x,y,surf3,[-0.5, 1],style=[1 1 1],strf="000")
207 xtitle("f(x,y) = x^3+y^2, com partes abaixo de z = -0.5 e acima de z = 1 removidas")
208 drawnow() ;
209 show_window()
210  ]]></programlisting>
211         <scilab:image localized="true">
212             function z=surf3(x,y), z=x^3+y^2, endfunction
213             clf()
214             x = linspace(-1,1,60);
215             y = linspace(-1,1,60);
216             set(gcf(),"color_map",jetcolormap(128))
217             drawlater() ;
218             zminmax = [-0.5 1]; colors=[32 96];
219             colorbar(zminmax(1),zminmax(2),colors)
220             Sfgrayplot(x, y, surf3, strf="041", zminmax=zminmax, colout=[0 0], colminmax=colors)
221             contour2d(x,y,surf3,[-0.5, 1],style=[1 1 1],strf="000")
222             xtitle("f(x,y) = x^3+y^2, com partes abaixo de z = -0.5 e acima de z = 1 removidas")
223             drawnow() ;
224             show_window()
225         </scilab:image>
226     </refsection>
227     <refsection role="see also">
228         <title>Ver Também</title>
229         <simplelist type="inline">
230             <member>
231                 <link linkend="fec">fec</link>
232             </member>
233             <member>
234                 <link linkend="fgrayplot">fgrayplot</link>
235             </member>
236             <member>
237                 <link linkend="grayplot">grayplot</link>
238             </member>
239             <member>
240                 <link linkend="Sgrayplot">Sgrayplot</link>
241             </member>
242         </simplelist>
243     </refsection>
244 </refentry>