<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 11pt; font-family: "Book Antiqua",Palatino,serif'>
<p>Hi,</p>
<p>In the meantime I've managed to achieve the main goal. An additional problem appeared with my figure f2. Here is my function:</p>
<pre style="font-family: Monospaced; font-style: normal; font-size: 14.0;"><span style="color: #b01813;">function</span> <span style="color: #000000; text-decoration: underline;">colorplot</span><span style="color: #4a55db;">(</span><span style="color: #834310; font-weight: bold;">T</span><span style="color: #000000;">, </span><span style="color: #834310; font-weight: bold;">f2</span><span style="color: #4a55db;">)</span>

    <span style="color: #000000;">t</span><span style="color: #5c5c5c;">=</span><span style="color: #32b9b9;">diag</span><span style="color: #4a55db;">(</span><span style="color: #834310; font-weight: bold;">T</span><span style="color: #4a55db;">)</span><span style="color: #000000;">;</span>
    <span style="color: #000000;">mt</span><span style="color: #5c5c5c;">=</span><span style="color: #32b9b9;">size</span><span style="color: #4a55db;">(</span><span style="color: #000000;">t</span><span style="color: #000000;">,</span><span style="color: #bc8f8f;">'</span><span style="color: #bc8f8f;">r</span><span style="color: #bc8f8f;">'</span><span style="color: #4a55db;">)</span><span style="color: #000000;">;</span>
    <span style="color: #4a55db;">[</span><span style="color: #000000;">sort_t</span><span style="color: #000000;">,</span><span style="color: #000000;">index_sort_t</span><span style="color: #4a55db;">]</span><span style="color: #5c5c5c;">=</span><span style="color: #32b9b9;">gsort</span><span style="color: #4a55db;">(</span><span style="color: #000000;">t</span><span style="color: #000000;">,</span><span style="color: #bc8f8f;">'</span><span style="color: #bc8f8f;">g</span><span style="color: #bc8f8f;">'</span><span style="color: #000000;">,</span><span style="color: #bc8f8f;">'</span><span style="color: #bc8f8f;">i</span><span style="color: #bc8f8f;">'</span><span style="color: #4a55db;">)</span><span style="color: #000000;">;</span>

    <span style="color: #834310; font-weight: bold;">f2</span><span style="color: #5c5c5c;">.</span><span style="color: #aaaaaa;">color_map</span><span style="color: #5c5c5c;">=</span><span style="color: #ae5cb0; text-decoration: underline;">jetcolormap</span><span style="color: #4a55db;">(</span><span style="color: #000000;">mt</span><span style="color: #4a55db;">)</span><span style="color: #000000;">;</span>

    <span style="color: #a020f0;">for</span> <span style="color: #000000;">i</span><span style="color: #5c5c5c;">=</span><span style="color: #bc8f8f;">1</span><span style="color: #ffaa00;">:</span><span style="color: #000000;">mt</span>
        <span style="color: #834310; font-weight: bold;">f2</span><span style="color: #5c5c5c;">.</span><span style="color: #aaaaaa;">children</span><span style="color: #4a55db;">(</span><span style="color: #bc8f8f;">1</span><span style="color: #4a55db;">)</span><span style="color: #5c5c5c;">.</span><span style="color: #aaaaaa;">children</span><span style="color: #4a55db;">(</span><span style="color: #bc8f8f;">7</span><span style="color: #4a55db;">)</span><span style="color: #5c5c5c;">.</span><span style="color: #aaaaaa;">children</span><span style="color: #4a55db;">(</span><span style="color: #000000;">mt</span><span style="color: #5c5c5c;">-</span><span style="color: #4a55db;">(</span><span style="color: #000000;">index_sort_t</span><span style="color: #4a55db;">(</span><span style="color: #000000;">i</span><span style="color: #4a55db;">)</span><span style="color: #5c5c5c;">-</span><span style="color: #bc8f8f;">1</span><span style="color: #4a55db;">)</span><span style="color: #4a55db;">)</span><span style="color: #5c5c5c;">.</span><span style="color: #aaaaaa;">foreground</span><span style="color: #5c5c5c;">=</span><span style="color: #000000;">i</span><span style="color: #000000;">;</span>
    <span style="color: #a020f0;">end</span>
    
    <span style="color: #ae5cb0; text-decoration: underline;">colorbar</span><span style="color: #4a55db;">(</span><span style="color: #32b9b9;">min</span><span style="color: #4a55db;">(</span><span style="color: #000000;">t</span><span style="color: #4a55db;">)</span><span style="color: #000000;">,</span><span style="color: #32b9b9;">max</span><span style="color: #4a55db;">(</span><span style="color: #000000;">t</span><span style="color: #4a55db;">)</span><span style="color: #000000;">,</span><span style="color: #4a55db;">[</span><span style="color: #bc8f8f;">1</span><span style="color: #000000;">,</span><span style="color: #000000;">mt</span><span style="color: #4a55db;">]</span><span style="color: #4a55db;">)</span><span style="color: #000000;">;</span>
    <span style="color: #834310; font-weight: bold;">f2</span><span style="color: #5c5c5c;">.</span><span style="color: #aaaaaa;">children</span><span style="color: #4a55db;">(</span><span style="color: #bc8f8f;">2</span><span style="color: #4a55db;">)</span><span style="color: #5c5c5c;">.</span><span style="color: #aaaaaa;">children</span><span style="color: #4a55db;">(</span><span style="color: #bc8f8f;">15</span><span style="color: #4a55db;">)</span><span style="color: #5c5c5c;">.</span><span style="color: #aaaaaa;">visible</span><span style="color: #5c5c5c;">=</span><span style="color: #bc8f8f;">"</span><span style="color: #bc8f8f;">off</span><span style="color: #bc8f8f;">"</span><span style="color: #000000;">;</span>
    
<span style="color: #b01813;">endfunction<br /><br /><span style="font-family: book antiqua, palatino, serif; color: #000000; font-size: 11pt;">Unfortunately the last line, which should switch off the visibility of a group of polylines, doesn't work inside the function. When I put this line in the console after calling function colorplot it works fine. Maybe someone could help me with this?<br /><br />Kind regards,<br />Iza</span><br /></span></pre>
<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>
<p><br /></p>
<p id="reply-intro">W dniu 15.11.2021 13:38, Izabela Wójcik-GrzÄ…ba napisaÅ‚(a):</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div style="font-size: 11pt; font-family: 'Book Antiqua',Palatino,serif;">
<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="v1signature">-- <br />
<div class="v1pre" 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>
</div>
</div>
<br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">_______________________________________________<br />users mailing list<br /><a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br /><a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank" rel="noopener noreferrer">http://lists.scilab.org/mailman/listinfo/users</a></div>
</blockquote>
</body></html>