[Scilab-users] jetcolormap in param3d1

Izabela Wójcik-Grząba iwoj at il.pw.edu.pl
Mon Nov 15 18:12:13 CET 2021


Hi, 

In the meantime I've managed to achieve the main goal. An additional
problem appeared with my figure f2. Here is my function:

function colorplot(T, f2)

    t=diag(T);
    mt=size(t,'r');
    [sort_t,index_sort_t]=gsort(t,'g','i');

    f2.color_map=jetcolormap(mt);

    for i=1:mt
       
f2.children(1).children(7).children(mt-(index_sort_t(i)-1)).foreground=i;
    end

    colorbar(min(t),max(t),[1,mt]);
    f2.children(2).children(15).visible="off";

endfunction

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?

Kind regards,
Iza

---
Izabela Wójcik-Grząba
Zespół Konstrukcji Metalowych
ZKBiM IIB WIL Politechnika Warszawska

W dniu 15.11.2021 13:38, Izabela Wójcik-Grząba napisał(a):

> Hello, 
> 
> 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): 
> 
> X=[0.5 1.5 1.5 ; 1.5 2.5 1.5]; 
> 
> Y=[0.5 1 1 ; 1 0.5 2]; 
> 
> Z=[0 1 1 ; 1 2 3]; 
> 
> T=[2 1 3]; 
> 
> [sorted_T, index_sort_T]=gsort(T , 'g' , 'i'); 
> 
> colors=zeros(size(T , 'r'); 
> 
> colors(index_sort_T , :)=jetcolormap(size(T , 'r'); 
> 
> param3d1(X,Y,Z); 
> 
> h=gca().children(1); 
> 
> h.children.thickness=4; 
> 
> for i=size(T,'r') 
> 
> h.children(i).color=??? 
> 
> end 
> 
> Instead of question marks there should be a color index, but I don't know how to define it using jetcolormap. 
> 
> I would be grateful for your kind help,
> 
> -- 
> Izabela Wójcik-Grząba
> Zespół Konstrukcji Metalowych
> ZKBiM IIB WIL Politechnika Warszawska
> 
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20211115/32eae42b/attachment.htm>


More information about the users mailing list