<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Hello Izabela,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">The current colormap is always stored
as a figure's property, as shown for instance in the examples at
<a class="moz-txt-link-freetext" href="https://help.scilab.org/docs/6.1.1/en_US/colormap.html">https://help.scilab.org/docs/6.1.1/en_US/colormap.html</a><br>
</div>
<div class="moz-cite-prefix">Here is a possible implementation
(without the gsort stuff):</div>
<div class="moz-cite-prefix">
<pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><span style="color:rgb(0,0,0);">X</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(74,85,219);">[</span><span style="color:rgb(188,143,143);">0.5</span> <span style="color:rgb(188,143,143);">1.5</span> <span style="color:rgb(188,143,143);">1.5</span> <span style="color:rgb(0,0,0);">;</span> <span style="color:rgb(188,143,143);">1.5</span> <span style="color:rgb(188,143,143);">2.5</span> <span style="color:rgb(188,143,143);">1.5</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">Y</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(74,85,219);">[</span><span style="color:rgb(188,143,143);">0.5</span> <span style="color:rgb(188,143,143);">1</span> <span style="color:rgb(188,143,143);">1</span> <span style="color:rgb(0,0,0);">;</span> <span style="color:rgb(188,143,143);">1</span> <span style="color:rgb(188,143,143);">0.5</span> <span style="color:rgb(188,143,143);">2</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">Z</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(74,85,219);">[</span><span style="color:rgb(188,143,143);">0</span> <span style="color:rgb(188,143,143);">1</span> <span style="color:rgb(188,143,143);">1</span> <span style="color:rgb(0,0,0);">;</span> <span style="color:rgb(188,143,143);">1</span> <span style="color:rgb(188,143,143);">2</span> <span style="color:rgb(188,143,143);">3</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">clf</span>
<span style="color:rgb(50,185,185);">param3d1</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">X</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">Y</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">Z</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">h</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(0,0,0);">gca</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">children</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">children</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">ccm</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(0,0,0);">gcf</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">color_map</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">ncurv</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">size</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">X</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">ncol</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">size</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">ccm</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(100,174,100);font-style:italic;">// proposal : extending the current color map, instead of replacing it:</span>
<span style="color:rgb(0,0,0);">gcf</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">color_map</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(74,85,219);">[</span><span style="color:rgb(0,0,0);">ccm</span> <span style="color:rgb(0,0,0);">;</span> <span style="color:rgb(0,0,0);">jetcolormap</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">ncurv</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">h</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">thickness</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">4</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">h</span><span style="color:rgb(92,92,92);">.</span><span style="color:rgb(170,170,170);">foreground</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(0,0,0);">ncol</span><span style="color:rgb(92,92,92);">+(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(0,0,0);"></span><span style="color:rgb(92,92,92);"></span><span style="color:rgb(0,0,0);">ncurv)</span><span style="color:rgb(0,0,0);">;</span> <span style="color:rgb(100,174,100);font-style:italic;">// </span><span style="color:rgb(100,174,100);font-style:italic;">"</span><span style="color:rgb(100,174,100);font-style:italic;">vectorized</span><span style="color:rgb(100,174,100);font-style:italic;">"</span><span style="color:rgb(100,174,100);font-style:italic;"> assignment allowed. for loop not required
</span>
</pre>
</div>
<div class="moz-cite-prefix">Hope this helps.<br>
Samuel<br>
<br>
</div>
<div class="moz-cite-prefix">Le 15/11/2021 à 13:38, Izabela
Wójcik-Grząba a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:ee41c9bf370e9a993d9398656d412400@il.pw.edu.pl">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p>Hello,</p>
<p>I need some help with a param3d1 graph. Each polyline should
have color from a colormap according to the value assigned in a
T vector. Here is a simple example (not finished):</p>
<p><span style="font-family: courier new, courier, monospace;">X=[0.5
1.5 1.5 ; 1.5 2.5 1.5];</span></p>
<p><span style="font-family: courier new, courier, monospace;">Y=[0.5
1 1 ; 1 0.5 2];</span></p>
<p><span style="font-family: courier new, courier, monospace;">Z=[0
1 1 ; 1 2 3];</span></p>
<p><span style="font-family: courier new, courier, monospace;">T=[2
1 3];</span></p>
<p><span style="font-family: courier new, courier, monospace;">[sorted_T,
index_sort_T]=gsort(T , 'g' , 'i');</span></p>
<p><span style="font-family: courier new, courier, monospace;">colors=zeros(size(T
, 'r');</span></p>
<p><span style="font-family: courier new, courier, monospace;">colors(index_sort_T
, :)=jetcolormap(size(T , 'r');</span></p>
<p><span style="font-family: courier new, courier, monospace;">param3d1(X,Y,Z);</span></p>
<p><span style="font-family: courier new, courier, monospace;">h=gca().children(1);</span></p>
<p><span style="font-family: courier new, courier, monospace;">h.children.thickness=4;</span></p>
<p><span style="font-family: courier new, courier, monospace;">for
i=size(T,'r')</span></p>
<p><span style="font-family: courier new, courier, monospace;">h.children(i).color=???</span></p>
<p><span style="font-family: courier new, courier, monospace;">end</span></p>
<p>Instead of question marks there should be a color index, but I
don't know how to define it using jetcolormap.</p>
<p>I would be grateful for your kind help,</p>
<div id="signature">-- <br>
<div class="pre" style="margin: 0; padding: 0; font-family:
monospace"><span style="font-family: book antiqua, palatino,
serif;">Izabela Wójcik-Grząba</span><br>
<span style="font-family: book antiqua, palatino, serif;">Zespół
Konstrukcji Metalowych</span><br>
<span style="font-family: book antiqua, palatino, serif;">ZKBiM
IIB WIL Politechnika Warszawska</span><br>
<br>
</div>
</div>
</blockquote>
<br>
</body>
</html>