4
votes

Is it possible to have different colours in my plot in Scilab? I use the mtlb_hold to hold the graph and it works fine, but my problem is that then I have the same colours in my graph. In Matlab with the hold command, I have different colours. Is it possible to have different colours in Scilab too? Thank you in advance.

2

2 Answers

3
votes

Just found it. In the plot function, for example plot(), you can pass a second argument which specifies the color that will be used. For example, you can use use b for blue color, g for green, r for red and call plot() like this: plot(z,"r").

2
votes

The SciLab documentation provides examples for using colors: https://help.scilab.org/doc/5.3.3/en_US/color.html

The plot2d()-function e.g. accepts an attribute style, where you can even specify a color for each function with its full name:

plot2d(x,[sin(x),cos(x)],style=[color("red"),color("green")]);