[Scilab-users] jetcolormap in param3d1

Izabela Wójcik-Grząba iwoj at il.pw.edu.pl
Tue Nov 16 11:07:07 CET 2021


Thank you Samuel for your idea of extending current colormap. As I
understant there is no connection between the color and value of T for
each polyline in your proposition. As I wrote in my second post I've
managed to solve this problem. Maybe you could look at my second problem
described there? 

Regards, 

Iza

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

W dniu 16.11.2021 09:46, Samuel Gougeon napisał(a):

> Hello Izabela, 
> 
> The current colormap is always stored as a figure's property, as shown for instance in the examples at https://help.scilab.org/docs/6.1.1/en_US/colormap.html 
> Here is a possible implementation (without the gsort stuff): 
> 
> 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];
> clf
> param3d1(X,Y,Z);
> 
> h = gca().children(1).children;
> 
> ccm = gcf().color_map;
> ncurv = size(X,2);
> ncol = size(ccm,1);
> // proposal : extending the current color map, instead of replacing it:
> gcf().color_map = [ccm ; jetcolormap(ncurv)];
> 
> h.thickness = 4;
> h.foreground = ncol+(1:ncurv); // "vectorized" assignment allowed. for loop not required
> 
> Hope this helps.
> Samuel
> 
> Le 15/11/2021 à 13:38, Izabela Wójcik-Grząba a écrit : 
> 
>> 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/20211116/2e37af35/attachment.htm>


More information about the users mailing list