[Scilab-users] Needs help with surface plot & colormap
Dang, Christophe
Christophe.Dang at sidel.com
Wed Jun 12 17:26:51 CEST 2013
Hello,
De la part de surender_kumar
Envoyé : mardi 11 juin 2013 23:02
> I would like to do a
> colormap in such a way that the highest C value is most intense
> (say deep blue) while the lower values become more and more
> weaker..... finally the lowest C value having no color at all.
Well, the colormap is just a RGB matrix, the R, G and B components
ranging from 0 to 1.
So, deep blue is [0 0 1],
what is "colorless" for you?
White -> [1 1 1]
Black -> [0 0 0]
The *colormap (autumncolormap, coolcolormap, etc) instructions just
create matrices.
You can build your own colormap. The simplest way for you is to start
from a graycolormap, and force the last column to 1 for blue->white:
// **********
grayplot()
cmap = graycolormap(32);
cmap(:, 3) = 1;
xset("colormap", cmap)
// **********
or force the two first columns to 0 for blue->black
// **********
grayplot()
cmap = graycolormap(32);
cmap(:, 1:2) = 0;
xset("colormap", cmap)
// **********
"grayplot()" is just here to generate en example picture.
"32" is the number of levels, you can set any value.
Hope this helps
--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
More information about the users
mailing list