bf0b51c1cc07adf87ee196ef663783cb53943e7e
[scilab.git] / scilab / modules / graphics / help / en_US / color_management / colormap.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) INRIA
5  *
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <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">
17     <refnamediv>
18         <refname>colormap</refname>
19         <refpurpose>using colormaps</refpurpose>
20     </refnamediv>
21     <refsection>
22         <title>Description</title>
23         <para>
24             A colormap <literal>cmap</literal> is defined by a m x 3 matrix. m is the number of colors.
25             Color number i is given as a 3-uple <literal>cmap(i,1)</literal>, <literal>cmap(i,2)</literal>
26             <literal>cmap(i,3)</literal>
27             corresponding respectively to red, green and blue intensity between
28             0 and 1.
29         </para>
30         <para>
31             At the beginning, 32 colors are defined in the colormap. You can
32             change the colormap of a figure by using <literal>set(f,"color_map",cmap)</literal>
33             where <literal>f</literal> is the handle of the figure.
34         </para>
35         <para>
36             Each color in the colormap has an id you have to use to specify color
37             in most plot functions. To see the ids, use function <link linkend="getcolor">getcolor</link>.
38         </para>
39         <para>
40             The functions <link linkend="hotcolormap">hotcolormap</link>, <link linkend="jetcolormap">jetcolormap</link> and  <link linkend="graycolormap">graycolormap</link>
41             provide colormaps with continuous variation of the colors.
42         </para>
43         <para>
44             You can get the default colormap by <literal>cmap=get(sdf(),"color_map")</literal>.
45         </para>
46     </refsection>
47     <refsection>
48         <title>Examples</title>
49         <programlisting role="example"><![CDATA[
50 n=64;
51 r=linspace(0,1,n)';
52 g=linspace(1,0,n)';
53 b=ones(r);
54 cmap=[r g b];
55 f=gcf(); f.color_map=cmap;
56 plot3d1()
57 f.color_map=get(sdf(),"color_map");
58  ]]></programlisting>
59         <scilab:image>
60             n=64;
61             r=linspace(0,1,n)';
62             g=linspace(1,0,n)';
63             b=ones(r);
64             cmap=[r g b];
65             f=gcf(); f.color_map=cmap;
66             plot3d1()
67             f.color_map=get(sdf(),"color_map");
68         </scilab:image>
69
70     </refsection>
71     <refsection role="see also">
72         <title>See also</title>
73         <simplelist type="inline">
74             <member>
75                 <link linkend="autumncolormap">autumncolormap</link>
76             </member>
77             <member>
78                 <link linkend="bonecolormap">bonecolormap</link>
79             </member>
80             <member>
81                 <link linkend="coolcolormap">coolcolormap</link>
82             </member>
83             <member>
84                 <link linkend="coppercolormap">coppercolormap</link>
85             </member>
86             <member>
87                 <link linkend="graycolormap">graycolormap</link>
88             </member>
89             <member>
90                 <link linkend="hotcolormap">hotcolormap</link>
91             </member>
92             <member>
93                 <link linkend="hsvcolormap">hsvcolormap</link>
94             </member>
95             <member>
96                 <link linkend="jetcolormap">jetcolormap</link>
97             </member>
98             <member>
99                 <link linkend="oceancolormap">oceancolormap</link>
100             </member>
101             <member>
102                 <link linkend="parulacolormap">parulacolormap</link>
103             </member>
104             <member>
105                 <link linkend="pinkcolormap">pinkcolormap</link>
106             </member>
107             <member>
108                 <link linkend="rainbowcolormap">rainbowcolormap</link>
109             </member>
110             <member>
111                 <link linkend="springcolormap">springcolormap</link>
112             </member>
113             <member>
114                 <link linkend="summercolormap">summercolormap</link>
115             </member>
116             <member>
117                 <link linkend="whitecolormap">whitecolormap</link>
118             </member>
119             <member>
120                 <link linkend="wintercolormap">wintercolormap</link>
121             </member>
122             <member>
123                 <link linkend="color">color</link>
124             </member>
125             <member>
126                 <link linkend="getcolor">getcolor</link>
127             </member>
128         </simplelist>
129     </refsection>
130 </refentry>