Getting map with colormaps (or the other way round)
Reported by Antoine Monmayrant
Originally assigned to Calixte DENIZET
I have heard through the grapevine that the current development of Scilab focusses on hiding the underlying complexity to the end user (who said that, S.L.?). Concerning colormaps, well, it is far from a success.
There is something completely broken with the current way of handling colormaps. Here is a real life example: you use "grayplot" to plot a 2D intensity map of a signal of interest and then you use "plot" to overlay some complementary data.
Argh, kaboom, you get bitten hard if you are fool enough to choose for the overlayed line a color that was not present in the current colormap:
x=[-1:0.1:1];
y=[-1:0.1:1]';
z=cos(y*x);
//reference grayplot
h1=scf();
h1.color_map=hotcolormap(6);
grayplot(x,y,z);
xtitle("That looks good and should stay like this");
//adding lines: why is my grayplot changing?
h2=scf();
h2.color_map=hotcolormap(6);
grayplot(x,y,z);
plot(x,y);
xtitle("What the hell happened to my fancy grayplot?");
//adding more lines: argghhhh!
h3=scf();
h3.color_map=hotcolormap(6);
grayplot(x,y,z);
plot(x,y);
plot(x,-y,'g');
xtitle("Irony: the color you picked for good visibility is transfered into the background plot!");