[scilab-Users] Matplot with colorbar and negative values

Samuel Gougeon sgougeon at free.fr
Fri Oct 14 01:33:37 CEST 2011


Le 09/10/2011 19:47, joschi a écrit :
> .../...
> z=[-1 7 5;2 4 -7;8 -6 12;5 9 3];
>
> //Plot
> clf
> ncol=10;
> xset("colormap",jetcolormap(ncol)); // Choose colormap (see the help of colormap)
> xtitle("Effect", "Variable", "Response");
> colorbar(-5,5,[1,ncol],fmt="%.2f"); // Draw a colorbar
> c=z-min(z);
> c=round((ncol-1)*c/max(c))+1;
> Matplot(c);
>
> .../...
>
> Last is how can i add more tics to the colorbar. By default i get 4 values
> shown at the solorbar, but i wanna have, for my example from 1 to 9 an entry
> at the colorbar 1 2 3 4 5 6 7 8 9.
>    
You may try and adapt the following example:

f = gcf();
cb = f.children(1);
cb.y_ticks=tlist(["ticks" "locations" "labels"],-5:5,string(-5:5));

Samuel



More information about the users mailing list