The "colo" option of plot is not vectorized.
Reported by Michael BAUDIN
BUG DESCRIPTION:
----------------
The "colo" option of plot is not vectorized.
In the script below, we create an array y with two columns : the first column is for the cos function, and the second column is for the sin function, both on the [0,3] interval. The plot function allows to plot two lines with one single call to plot. On the other hand, the "colo" option allows to set the RGB color for a plot. This is why we pass to "colo" an array c with two columns : the first column in c being the RGB color for the first column in y, the second column in c being the color for the second column in y.
The bug is that the c argument is ignored, with the warning :
{{{
AVERTISSEMENT : setPlotProperty : Dimension erronée de l'argument d'entrée n°2 : Un vecteur de taille 3x1 ou 1x3 attendu.
}}}
Indeed, plot uses the undocumented function setPlotProperty at line 427, which configures the color. The bug is that plot assumes that there is only one color in the input argument, although there are several. When setPlotProperty checks the size of the 2nd argument (i.e. the RGB array) , it produces the previous warning.
In the end, I think that the limitation of "plot" is indeed a limitation of "setPlotProperty".
HOW TO REPRODUCE THE BUG:
-------------------------
{{{
x=linspace(0,3)';
y=[cos(x),sin(x)];
c=[0.25,1.;0,0.25;0.25,0.];
plot(x,y,"colo",c)
legend(["cos","sin"]);
}}}