<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA
 *
 * 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="en" xml:id="colormap">
    <refnamediv>
        <refname>colormap</refname>
        <refpurpose>using colormaps</refpurpose>
    </refnamediv>
    <refsection>
        <title>Description</title>
        <para>
            A colormap <literal>cmap</literal> is defined by a m x 3 matrix. m is the number of colors.
            Color number i is given as a 3-uple <literal>cmap(i,1)</literal>, <literal>cmap(i,2)</literal>
            <literal>cmap(i,3)</literal>
            corresponding respectively to red, green and blue intensity between
            0 and 1.
        </para>
        <para>
            At the beginning, 32 colors are defined in the colormap. You can
            change the colormap of a figure by using <literal>set(f,"color_map",cmap)</literal>
            where <literal>f</literal> is the handle of the figure.
        </para>
        <para>
            Each color in the colormap has an id you have to use to specify color
            in most plot functions. To see the ids, use function <link linkend="getcolor">getcolor</link>.
        </para>
        <para>
            The functions <link linkend="hotcolormap">hotcolormap</link>, <link linkend="jetcolormap">jetcolormap</link> and  <link linkend="graycolormap">graycolormap</link>
            provide colormaps with continuous variation of the colors.
        </para>
        <para>
            You can get the default colormap by <literal>cmap=get(sdf(),"color_map")</literal>.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
n=64;
r=linspace(0,1,n)';
g=linspace(1,0,n)';
b=ones(r);
cmap=[r g b];
f=gcf(); f.color_map=cmap;
plot3d1()
f.color_map=get(sdf(),"color_map");
 ]]></programlisting>
        <scilab:image>
            n=64;
            r=linspace(0,1,n)';
            g=linspace(1,0,n)';
            b=ones(r);
            cmap=[r g b];
            f=gcf(); f.color_map=cmap;
            plot3d1()
            f.color_map=get(sdf(),"color_map");
        </scilab:image>

    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="autumncolormap">autumncolormap</link>
            </member>
            <member>
                <link linkend="bonecolormap">bonecolormap</link>
            </member>
            <member>
                <link linkend="coolcolormap">coolcolormap</link>
            </member>
            <member>
                <link linkend="coppercolormap">coppercolormap</link>
            </member>
            <member>
                <link linkend="graycolormap">graycolormap</link>
            </member>
            <member>
                <link linkend="hotcolormap">hotcolormap</link>
            </member>
            <member>
                <link linkend="hsvcolormap">hsvcolormap</link>
            </member>
            <member>
                <link linkend="jetcolormap">jetcolormap</link>
            </member>
            <member>
                <link linkend="oceancolormap">oceancolormap</link>
            </member>
            <member>
                <link linkend="parulacolormap">parulacolormap</link>
            </member>
            <member>
                <link linkend="pinkcolormap">pinkcolormap</link>
            </member>
            <member>
                <link linkend="rainbowcolormap">rainbowcolormap</link>
            </member>
            <member>
                <link linkend="springcolormap">springcolormap</link>
            </member>
            <member>
                <link linkend="summercolormap">summercolormap</link>
            </member>
            <member>
                <link linkend="whitecolormap">whitecolormap</link>
            </member>
            <member>
                <link linkend="wintercolormap">wintercolormap</link>
            </member>
            <member>
                <link linkend="color">color</link>
            </member>
            <member>
                <link linkend="getcolor">getcolor</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
