File: Sfgrayplot.xml

package info (click to toggle)
scilab 5.2.2-9
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 334,832 kB
  • ctags: 52,586
  • sloc: xml: 526,945; ansic: 223,590; fortran: 163,080; java: 56,934; cpp: 33,840; tcl: 27,936; sh: 20,397; makefile: 9,908; ml: 9,451; perl: 1,323; cs: 614; lisp: 30
file content (202 lines) | stat: -rw-r--r-- 6,070 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) ENPC - Jean-Philippe Chancelier
 * 
 * This file must be used under the terms of the CeCILL.
 * This source file is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
 * are also available at    
 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 *
 -->
<refentry version="5.0-subset Scilab" xml:id="Sfgrayplot" xml:lang="en"
          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">
  <info>
    <pubdate>$LastChangedDate$</pubdate>
  </info>

  <refnamediv>
    <refname>Sfgrayplot</refname>

    <refpurpose>esboo 2d suave de uma superfcie definida por uma funo
    utilizando cores </refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <title>Seqncia de Chamamento</title>

    <synopsis>Sfgrayplot(x,y,f,&lt;opt_args&gt;)
Sfgrayplot(x,y,f [,strf, rect, nax, zminmax, colminmax, mesh, colout])</synopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Parmetros</title>

    <variablelist>
      <varlistentry>
        <term>x,y</term>

        <listitem>
          <para>vetores linhas de reais de tamanhos n1 e n2. </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>f</term>

        <listitem>
          <para>funo do Scilab (z=f(x,y)) </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>&lt;opt_args&gt;</term>

        <listitem>
          <para>representa uma seqncia de declaraes <literal>key1=value1,
          key2=value2</literal>,... onde <literal>key1</literal>,
          <literal>key2,...</literal> podem ser um dos seguintes: strf, rect,
          nax, zminmax, colminmax, mesh, colout (ver <link
          linkend="plot2d">plot2d</link> para os trs primeiros e <link
          linkend="fec">fec</link> para os quatro ltimos).</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>strf,rect,nax</term>

        <listitem>
          <para>ver <link linkend="plot2d">plot2d</link>.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>zminmax, colminmax, mesh, colout</term>

        <listitem>
          <para>ver <link linkend="fec">fec</link>.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>

  <refsection>
    <title>Descrio</title>

    <para><literal>Sfgrayplot</literal>  o mesmo que
    <literal>fgrayplot</literal> mas o esboo  suavizado. A funo
    <literal>fec</literal>  utilizada para suavizao. A superfcie 
    esboada assumindo-se que  linear em um conjunto de tringulos
    construdos a partir do grid (aqui, com n1=5, n2=3):</para>

    <programlisting role = ""><![CDATA[ 
_____________
| /| /| /| /|
|/_|/_|/_|/_| 
| /| /| /| /| 
|/_|/_|/_|/_|
 ]]></programlisting>

    <para>A funo <link linkend="colorbar">colorbar</link> pode ser utilizada
    para se visualizar a escala de cores (mas voc deve saber (ou computar) os
    valores mnimo e mximo).</para>

    <para>Ao invs de Sfgrayplot, voc pode usar <link
    linkend="Sgrayplot">Sgrayplot</link> este pode ser um pouco mais
    rpido.</para>

    <para>Entre com o comando <literal>Sfgrayplot()</literal> para visualizar
    uma demonstrao.</para>
  </refsection>

  <refsection>
    <title>Exemplos</title>

    <programlisting role="example"><![CDATA[ 
// exemplo #1: esboo de 4 superfcies
function z=surf1(x,y), z=x*y, endfunction
function z=surf2(x,y), z=x^2-y^2, endfunction
function z=surf3(x,y), z=x^3+y^2, endfunction
function z=surf4(x,y), z=x^2+y^2, endfunction
xbasc()
xset("colormap",[jetcolormap(64);hotcolormap(64)])
x = linspace(-1,1,60);
y = linspace(-1,1,60);
drawlater() ;
subplot(2,2,1)
   colorbar(-1,1,[1,64])
   Sfgrayplot(x,y,surf1,strf="041",colminmax=[1,64])
   xtitle("f(x,y) = x*y")
subplot(2,2,2)
   colorbar(-1,1,[65,128])
   Sfgrayplot(x,y,surf2,strf="041",colminmax=[65,128])
   xtitle("f(x,y) = x^2-y^2")
subplot(2,2,3)
   colorbar(-1,2,[65,128])
   Sfgrayplot(x,y,surf3,strf="041",colminmax=[65,128])
   xtitle("f(x,y) = x^3+y^2")
subplot(2,2,4)
   colorbar(0,2,[1,64])
   Sfgrayplot(x,y,surf4,strf="041",colminmax=[1,64])
   xtitle("f(x,y) = x^2+y^2")
drawnow() ;
xselect()

// exemplo #2: esboo de surf3 e adio de algumas linhas de contorno
function z=surf3(x,y), z=x^3+y^2, endfunction
xbasc()
x = linspace(-1,1,60);
y = linspace(-1,1,60);
xset("colormap",hotcolormap(128))
drawlater() ;
colorbar(-1,2)
Sfgrayplot(x,y,surf3,strf="041")
fcontour2d(x,y,surf3,[-0.1, 0.025, 0.4],style=[1 1 1],strf="000")
xtitle("f(x,y) = x^3+y^2")
drawnow() ;
xselect()

// exemplo #3: esboo de surf3 e uso dos argumentos opcionais zminmax e colout
//             para restringir o esboo em -0.5&lt;= z &lt;= 1
function z=surf3(x,y), z=x^3+y^2, endfunction
xbasc()
x = linspace(-1,1,60);
y = linspace(-1,1,60);
xset("colormap",jetcolormap(128))
drawlater() ;
zminmax = [-0.5 1]; colors=[32 96];
colorbar(zminmax(1),zminmax(2),colors)
Sfgrayplot(x, y, surf3, strf="041", zminmax=zminmax, colout=[0 0], colminmax=colors)
fcontour2d(x,y,surf3,[-0.5, 1],style=[1 1 1],strf="000")
xtitle("f(x,y) = x^3+y^2, com partes abaixo de z = -0.5 e acima de z = 1 removidas")
drawnow() ;
xselect()
 ]]></programlisting>
  </refsection>

  <refsection>
    <title>Ver Tambm</title>

    <simplelist type="inline">
      <member><link linkend="fec">fec</link></member>

      <member><link linkend="fgrayplot">fgrayplot</link></member>

      <member><link linkend="grayplot">grayplot</link></member>

      <member><link linkend="Sgrayplot">Sgrayplot</link></member>
    </simplelist>
  </refsection>

  <refsection>
    <title>Autor</title>

    <para>J.Ph.C.</para>
  </refsection>
</refentry>