[scilab-Users] Matplot with colorbar and negative values

Serge Steer Serge.Steer at inria.fr
Sun Oct 9 22:08:37 CEST 2011


The Matplot argument must be a matrix of color indices

so you should do
c=z-min(z);c=round((ncol-1)*c/max(c))+1
Matplot(c)

Serge Steer

Le 09/10/2011 19:47, joschi a écrit :
> Hi Group,
>
> i try to do a plot for a matrix with contains negative values. If i try to
> plot the matrix with Matplot i got with or black fields for the negative
> values. Plz. try my example.
>
> What i am doing wrong?
>
> z=[-1 -7 5;2 4 7;8 6 9];
> scf();
> ncol=10;
> xset("colormap",jetcolormap(ncol));
> xtitle("Effect", "Variable", "Response");
> colorbar(min(z),max(z),[1,ncol],fmt="%.2f");
> Matplot(z);
>
>
> Next prob is that if i wanna have more color than values e.g. ncol=32, the
> values are not set right.
> red is corresponding to the last value (here: 9) but thes are all color blue
>
> z=[1 7 5;2 4 7;8 6 9];
> scf();
> ncol=32;
> xset("colormap",jetcolormap(ncol));
> xtitle("Effect", "Variable", "Response");
> colorbar(min(z),max(z),[1,ncol],fmt="%.2f");
> Matplot(z);
>
> 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.
>
> Thanks in advance
>
> --
> View this message in context: http://mailinglists.scilab.org/Matplot-with-colorbar-and-negative-values-tp3407767p3407767.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
>




More information about the users mailing list