<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 1992 - INRIA - Serge Steer
 *
 * 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:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="graduate">
    <refnamediv>
        <refname>graduate</refname>
        <refpurpose>見栄えの良い軸のグラデーション</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>呼び出し手順</title>
        <synopsis>[xi,xa,np]=graduate( xmi, xma,n1,n2)
            [xi,xa,np]=graduate( xmi, xma)
        </synopsis>
    </refsynopsisdiv>
    <refsection role="parameters">
        <title>引数</title>
        <variablelist>
            <varlistentry>
                <term>xmi,xma</term>
                <listitem>
                    <para>実数スカラー</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>n1, n2</term>
                <listitem>
                    <para>デフォルト値 3,10の整数</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>xi, xa</term>
                <listitem>
                    <para>実数スカラー</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>np</term>
                <listitem>
                    <para>整数</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection role="description">
        <title>説明</title>
        <para>
            graduateは,以下の条件を満たすような
            間隔の最小値<literal>[xi,xa]</literal>と目盛の数<literal>np</literal>
            を探します:
        </para>
        <para>
            <literal>xi &lt;= xmi &lt;= xma &lt;= xa</literal>
        </para>
        <para>
            ある整数 <literal>n</literal>に関して<literal>k</literal>を
            <literal>[1 3 5]</literal>とする時,
            <literal>xa - xi / np  =  k(10^n)</literal>
        </para>
        <para>
            <literal>n1 &lt; np &lt; n2</literal>
        </para>
    </refsection>
    <refsection role="examples">
        <title>例</title>
        <programlisting role="example"><![CDATA[
y = (0:0.33:145.78)';
clf();
subplot(1,2,1)
plot2d(y)

subplot(1,2,2)
[ymn,ymx,np] = graduate(min(y), max(y))
rect = [1, ymn, prod(size(y)),ymx];
plot2d([], y, 1,'011',' ',rect,[10,3,10,np])
]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>参照</title>
        <simplelist type="inline">
            <member>
                <link linkend="xsetech">xsetech</link>
            </member>
            <member>
                <link linkend="plot2d">plot2d</link>
            </member>
        </simplelist>
    </refsection>
</refentry>