<?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="ja">
    <refnamediv>
        <refname>contourf</refname>
        <refpurpose>2次元プロット上に曲面の塗りつぶした等高線を描画</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>呼び出し手順</title>
        <synopsis>
            contourf(x, y, z, nz, [style, strf, leg, rect, nax, fpf])
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>引数</title>
        <variablelist>
            <varlistentry>
                <term>x,y</term>
                <listitem>
                    <para>
                        大きさ <literal>n1</literal> および <literal>n2</literal> の実数行ベクトル: グリッド.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>z</term>
                <listitem>
                    <para>
                        大きさ<literal>(n1,n2)</literal>の実数行列, 関数の値.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>nz</term>
                <listitem>
                    <para>等高線の値または数.</para>
                    <variablelist>
                        <varlistentry>
                            <term>-</term>
                            <listitem>
                                <para>
                                    <literal>nz</literal> が整数の場合, その値は等高線の数を
                                    指定し,  <literal>zmin</literal> から <literal>zmax</literal>
                                    の間で以下のように等間隔に配置されます:
                                </para>
                                <programlisting role="no-scilab-exec"><![CDATA[
z= zmin + (1:nz)*(zmax-zmin)/(nz+1)
 ]]></programlisting>
                                <para>
                                    <note>
                                        注意:
                                        <literal>zmin</literal> および <literal>zmax</literal>の等高線は描画されません (
                                        通常,これらは点に縮小されます)が,以下のコマンドで追加できることに
                                        注意してください.
                                    </note>
                                </para>
                                <programlisting role="no-scilab-exec"><![CDATA[
[im,jm] = find(z == zmin);     // または zmax
plot2d(x(im)',y(jm)',-9,"000")
 ]]></programlisting>
                            </listitem>
                        </varlistentry>
                        <varlistentry>
                            <term>-</term>
                            <listitem>
                                <para>
                                    <literal>nz</literal> がベクトルの場合,
                                    <literal>nz(i)</literal>は<literal>i</literal>
                                    番目の等高線の値を指定します.
                                </para>
                            </listitem>
                        </varlistentry>
                    </variablelist>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>style, strf, leg, rect, nax</term>
                <listitem>
                    <para>
                        <literal>plot2d</literal>参照. 引数
                        <literal>style</literal> は等高線で使用される色を指定します.
                        これは等高線の数と同じ大きさである必要があります.
                    </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>
        <title>説明</title>
        <para>
            <literal>contourf</literal> は,2次元プロット上の
            曲面<literal>z=f(x,y)</literal>の
            連続する2つの等高線の間の曲面を塗りつぶします.
            <literal>f(x,y)</literal>の値は<varname>x</varname>
            および<varname>y</varname>で定義されたグリッド点で
            行列<varname>z</varname>により指定されます.
        </para>
        <para>
            コマンド <code>contourf()</code>を入力することでデモを
            参照できます.
        </para>
    </refsection>
    <refsection>
        <title>例</title>
    </refsection>
    <refsection>
        <title>例</title>
        <programlisting role="example"><![CDATA[
contourf(1:10,1:10,rand(10,10),5,1:5,"011"," ",[0,0,11,11])
 ]]></programlisting>
        <scilab:image>
            contourf(1:10,1:10,rand(10,10),5,1:5,"011"," ",[0,0,11,11])
        </scilab:image>
        <programlisting role="example"><![CDATA[
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>
        <scilab:image>
            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],0*ones(1,m))
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>参照</title>
        <simplelist type="inline">
            <member>
                <link linkend="contour">contour</link>
            </member>
            <member>
                <link linkend="contour2d">contour2d</link>
            </member>
            <member>
                <link linkend="contour2di">contour2di</link>
            </member>
            <member>
                <link linkend="plot2d">plot2d</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
