assing specific colors according to pixels values of a grid2image map
1 view (last 30 days)
Show older comments
Hi to all!
I use grid2image function to create a map of my rasterized data. How can i assign specific values to pixels when they have cartain values? For example I want to have NaN pixels uncolored, pixels with value "1" colored blue, pixels with value "2" colored red etc.
Thank for your help.
Sakis
0 Comments
Answers (1)
Image Analyst
on 21 Jun 2015
I never heard of that function. You'll have to ask the author. The built-in MATLAB function that does that (I think) is TriScatteredInterp().
To do the pseudocoloring you asked for, just set up a colormap and use it:
myColorMap = zeros(256, 3);
myColorMap(2, :) = [0, 0, 1]; % Gray level 1 (which is at row 2) is blue
myColorMap(3, :) = [1, 0, 0]; % Gray level 2 is red
and so on.
0 Comments
See Also
Categories
Find more on White in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!