<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) ENPC - Jean-Philippe Chancelier
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<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="pt">
    <refnamediv>
        <refname>contourf</refname>
        <refpurpose>Curvas de nível preenchidas de uma superfície em um esboço
            2d
        </refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Seqüência de Chamamento</title>
        <synopsis>contourf(x, y, z, nz, [style, strf, leg, rect, nax, fpf])</synopsis>
    </refsynopsisdiv>
    <refsection role="parameters">
        <title>Parâmetrtos</title>
        <variablelist>
            <varlistentry>
                <term>x,y</term>
                <listitem>
                    <para>dois vetores de reais de tamanhos n1 e n2 definindo o grid.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>z</term>
                <listitem>
                    <para>matriz de reais de tamanho (n1,n2), os valores da função.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>nz</term>
                <listitem>
                    <para>os valores de nível ou o número de níveis.</para>
                    <variablelist>
                        <varlistentry>
                            <term>-</term>
                            <listitem>
                                <para>
                                    Se <literal>nz</literal> for um inteiro, seu valor
                                    fornece o número de níveis igualmente espaçados de zmin a zmax
                                    como segue:
                                </para>
                                <programlisting role=""><![CDATA[
z= zmin + (1:nz)*(zmax-zmin)/(nz+1)
 ]]></programlisting>
                                <para>
                                    Note que os níveis <literal>zmin</literal> e
                                    <literal>zmax</literal> não são desenhados (genericamente eles
                                    são reduzidos a pontos) mas podem ser adicionados através de
                                </para>
                                <programlisting role=""><![CDATA[
[im,jm] = find(z == zmin);     // ou zmax
plot2d(x(im)',y(jm)',-9,"000")
 ]]></programlisting>
                            </listitem>
                        </varlistentry>
                        <varlistentry>
                            <term>-</term>
                            <listitem>
                                <para>
                                    Se <literal>nz</literal> for um vetor,
                                    <literal>nz(i)</literal> fornece o valor da i-ésima curva de
                                    nível.
                                </para>
                            </listitem>
                        </varlistentry>
                    </variablelist>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>style,strf,leg,rect,nax</term>
                <listitem>
                    <para>
                        ver <literal>plot2d</literal>. O argumento
                        <literal>style</literal> fornece as cores a serem utilizadas pelas
                        curvas de nível. Deve ter o mesmo tamanho que o número de
                        níveis.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>fpf</term>
                <listitem>
                    <para>
                        You can change the format of the floating point number printed on
                        the levels where <varname>fpf</varname> is the format in C format syntax 
                        (for example <code>fpf="%.3f"</code>).
                        Set <varname>fpf</varname> to " " implies that the level are not drawn on the level curves.
                        If not given, the default format of <link linkend="contour2d">contour2d</link> is used.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection role="description">
        <title>Descrição</title>
        <para>
            <literal>contourf</literal> pinta a superfície entre duas curvas de
            nível consecutivas <literal>z=f(x,y)</literal> em um esboço 2d. Os valores
            de <literal>f(x,y)</literal> são fornecidos pela matriz
            <literal>z</literal> nos pontos de grid definidos por <literal>x</literal>
            e <literal>y</literal>.
        </para>
        <para>
            Entre com o comando <literal>contourf()</literal> para visualizar
            uma demonstração.
        </para>
    </refsection>
    <refsection role="examples">
        <title>Exemplos</title>
        <programlisting role="example"><![CDATA[
contourf(1:10,1:10,rand(10,10),5,1:5,"011"," ",[0,0,11,11])

function z = peaks(x,y)
   x1 = x(:).*.ones(1,size(y,'*'));
   y1 = y(:)'.*.ones(size(x,'*'),1);
   z =  (3*(1-x1).^2).*exp(-(x1.^2) - (y1+1).^2) ...
      - 10*(x1/5 - x1.^3 - y1.^5).*exp(-x1.^2-y1.^2) ...
      - 1/3*exp(-(x1+1).^2 - y1.^2)
endfunction

function z = peakit()
    x = -4:0.1:4
    y = x
    z = peaks(x,y)
endfunction

z = peakit();

levels = [-6:-1,-logspace(-5,0,10),logspace(-5,0,10),1:8];
m = size(levels,'*');
n = fix(3/8*m);
r = [(1:n)'/n; ones(m-n,1)];
g = [zeros(n,1); (1:n)'/n; ones(m-2*n,1)];
b = [zeros(2*n,1); (1:m-2*n)'/(m-2*n)];
h = [r g b];
gcf().color_map = h;
clf();
contourf([],[],z,[-6:-1,-logspace(-5,0,10),logspace(-5,0,10),1:8]);
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>Ver Também</title>
        <simplelist type="inline">
            <member>
                <link linkend="contour">contour</link>
            </member>
            <member>
                <link linkend="contour2di">contour2di</link>
            </member>
            <member>
                <link linkend="plot2d">plot2d</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
