[doc] uigetcolor() and colormap pages illustrated
[scilab.git] / scilab / modules / graphics / help / ja_JP / 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  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  * Copyright (C) 2021 - Samuel GOUGEON
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"
17           xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
18           xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
19           xml:lang="ja" xml:id="colormap">
20     <refnamediv>
21         <refname>colormap</refname>
22         <refpurpose>カラーマップを定義</refpurpose>
23     </refnamediv>
24     <refsection>
25         <title>説明</title>
26         <para>
27             カラーマップ <literal>cmap</literal> はm x 3行列で定義されます.
28             m は色の数です.
29             色番号 i は, それぞれ赤, 緑, 青の彩度(範囲は0から1)を表す
30             <literal>cmap(i,1)</literal>, <literal>cmap(i,2)</literal>,
31             <literal>cmap(i,3)</literal> の組で指定されます.
32         </para>
33         <para>
34             最初,カラーマップには32種類の色が定義されています.
35             特定の図のカラーマップを <literal>set(f,"color_map",cmap)</literal>
36             により変更することが可能です.
37             ただし,  <literal>f</literal>は図のハンドルです.
38         </para>
39         <para>
40             カラーマップの各色は,多くのプロット関数で色を指定するために使用する
41             際に使用されるIDを有しています.
42             このIDを参照するには,関数<link linkend="getcolor">getcolor</link>
43             を使用してください.
44         </para>
45         <para>
46             A set of functions from <link linkend="autumncolormap">autumncolormap(n)</link>
47             to <link linkend="wintercolormap">wintercolormap(n)</link> provide swatches that can be
48             set to colormaps. They are illustrated here-below.
49         </para>
50         <para>
51             The colormap of the current figure can be retrieved with <literal>cmap = gcf().color_map</literal>.
52         </para>
53         <para>
54             The current default colormap can be retrieved with <literal>cmap = gdf().color_map</literal>.
55         </para>
56         <para>
57             The factory default colormap can be retrieved with <literal>cmap = sdf().color_map</literal>.
58         </para>
59     </refsection>
60     <refsection>
61         <title>Sample</title>
62         <scilab:image localized="true">
63             cm = ["autumn" "bone" "cool" "copper" "gray" "hot" "hsv" "jet" "ocean" ..
64                   "parula" "pink" "rainbow" "spring" "summer" "white" "winter"];
65
66             ncm = size(cm,"*");
67             indices = [];
68             cmap = [];
69             for i = 0:ncm-1
70                 indices = [indices ; (1:100)+i*100];
71                 execstr("cols = "+cm(i+1)+"colormap(100);");
72                 cmap = [cmap ; cols];
73             end
74             f = gcf();
75             clf
76             f.color_map = cmap;
77             Matplot(indices)
78
79             xgrid([color("grey50") -1]);
80             gca().grid_position = "foreground";
81
82             title(_("Available swatches: #colormap(100)"), "fontsize", 4);
83             xlabel(_("Colors indices in [1,100]"), "fontsize", 3);
84             gca().y_ticks = tlist(["ticks" "locations" "labels"],16:-1:1,cm);
85             set(gca(), "font_size", 2, "sub_ticks",[4 0], "margins", [0.12 0.05 0.08 0.08]);
86
87             gcf().axes_size = [650 650];
88         </scilab:image>
89     </refsection>
90     <refsection>
91         <title>例</title>
92         <programlisting role="example"><![CDATA[
93 n = 64;
94 r = linspace(0,1,n)';
95 g = linspace(1,0,n)';
96 b = ones(r);
97 cmap = [r g b];
98 f = gcf(); f.color_map = cmap;
99 plot3d1()
100 f.color_map = gdf().color_map; // restores to the default colormap
101      ]]></programlisting>
102         <para/>
103         <programlisting role="example"><![CDATA[
104 gdf().color_map
105      ]]></programlisting>
106         <screen><![CDATA[
107 --> gdf().color_map
108  ans  =
109    0.          0.          0.
110    0.          0.          1.
111    0.          1.          0.
112    0.          1.          1.
113    1.          0.          0.
114    1.          0.          1.
115    1.          1.          0.
116    1.          1.          1.
117    0.          0.          0.5647059
118    0.          0.          0.6901961
119    0.          0.          0.8156863
120    0.5294118   0.8078431   1.
121    0.          0.5647059   0.
122    0.          0.6901961   0.
123    0.          0.8156863   0.
124    0.          0.5647059   0.5647059
125    0.          0.6901961   0.6901961
126    0.          0.8156863   0.8156863
127    0.5647059   0.          0.
128    0.6901961   0.          0.
129    0.8156863   0.          0.
130    0.5647059   0.          0.5647059
131    0.6901961   0.          0.6901961
132    0.8156863   0.          0.8156863
133    0.5019608   0.1882353   0.
134    0.627451    0.2509804   0.
135    0.7529412   0.3764706   0.
136    1.          0.5019608   0.5019608
137    1.          0.627451    0.627451
138    1.          0.7529412   0.7529412
139    1.          0.8784314   0.8784314
140    1.          0.8431373   0.
141 ]]></screen>
142     </refsection>
143     <refsection role="see also">
144         <title>参照</title>
145         <simplelist type="inline">
146             <member>
147                 <link linkend="autumncolormap">autumncolormap</link>
148             </member>
149             <member>
150                 <link linkend="bonecolormap">bonecolormap</link>
151             </member>
152             <member>
153                 <link linkend="coolcolormap">coolcolormap</link>
154             </member>
155             <member>
156                 <link linkend="coppercolormap">coppercolormap</link>
157             </member>
158             <member>
159                 <link linkend="graycolormap">graycolormap</link>
160             </member>
161             <member>
162                 <link linkend="hotcolormap">hotcolormap</link>
163             </member>
164             <member>
165                 <link linkend="hsvcolormap">hsvcolormap</link>
166             </member>
167             <member>
168                 <link linkend="jetcolormap">jetcolormap</link>
169             </member>
170             <member>
171                 <link linkend="oceancolormap">oceancolormap</link>
172             </member>
173             <member>
174                 <link linkend="pinkcolormap">pinkcolormap</link>
175             </member>
176             <member>
177                 <link linkend="rainbowcolormap">rainbowcolormap</link>
178             </member>
179             <member>
180                 <link linkend="springcolormap">springcolormap</link>
181             </member>
182             <member>
183                 <link linkend="summercolormap">summercolormap</link>
184             </member>
185             <member>
186                 <link linkend="whitecolormap">whitecolormap</link>
187             </member>
188             <member>
189                 <link linkend="wintercolormap">wintercolormap</link>
190             </member>
191             <member>
192                 <link linkend="color">color</link>
193             </member>
194             <member>
195                 <link linkend="getcolor">getcolor</link>
196             </member>
197             <member>
198                 <link linkend="colordef">colordef</link>
199             </member>
200         </simplelist>
201     </refsection>
202 </refentry>