[Scilab-users] {EXT} Curves color when plotting

Chin Luh Tan chinluh.tan at bytecode-asia.com
Tue Oct 22 04:47:32 CEST 2019


Hi,



from my understanding, easiest way to get the color you wanted is by specifying it during the plot function. 

--> plot(x,sin(x),'b')

--> plot(x,cos(x),'b')

will gives u 2 blue lines.





By default, scilab figure will following the sequence as stated in "help plot"





"A default color table is used to color plotted curves if you do not specify a color. When drawing multiple lines, the plot command automatically cycles through this table. Here are the used colors:"



R       G       B

0.      0.      1.

0.      0.5      0.

1.      0.      0.

0.      0.75  0.75

0.75  0.      0.75

0.75  0.75   0.

0.25  0.25   0.25



no matter what colormap you are changing to before the plot, the plot w/o color input will search for the "blue" in the newly define colormap as well. 



If the previous methods does not work for you, you could plot the graph, find the handle for the line, and change it according to the color index in the colormap for the figure.




plot(x,sin(x),x,cos(x))


f = gcf();

f.children.children.children.foreground

f.children.children.children.foreground(1) = 2;




this will change the second line to blue, as the default colormap f.colormap define blue in the second row. (f.color_map)




hope this helps.



rgds,
CL



---- On Mon, 21 Oct 2019 18:41:09 +0800 Dang Ngoc Chan, Christophe <mailto:Christophe.Dang at sidel.com> wrote ----



Hello Pierre, 
 
> De : Perrichon 
> Envoyé : lundi 21 octobre 2019 12:05 
> 
> Generally, when plotting, curves's color are taken in the range color 
> [1 3 5 7 9 11 13 15 [...] Is there a general way to modify this vector 
> as to get another one with blue as first curve. 
 
You might consider redefining the colour map: 
 
https://help.scilab.org/docs/6.0.2/en_US/colormap.html 
 
Hope this helps, 
 
regards 
 
-- 
Christophe Dang Ngoc Chan 
Mechanical calculation engineer 
 
General 
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. 
_______________________________________________ 
users mailing list 
mailto: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/20191022/4486f03b/attachment.htm>


More information about the users mailing list