MATLAB: How to use color sets in maps by defining intervals in matlab (for example: lower than 10 , between 10 and 50 , between 50 and 200, between 200 and 1000, greater than 1000). thanks

MATLAB

how to use color sets in maps by defining intervals in matlab (for example: lower than 10 , between 10 and 50 , between 50 and 200, between 200 and 1000, greater than 1000). thanks

Best Answer

Maybe like
cMap = zeros(1000, 3);
cMap(1:9, :) = [.4, .7, .3]; % Whatever color you want.



cMap(10:50, :) = [.8, .1, .6]; % Whatever color you want.
cMap(50:200, :) = [.6, .37, .8]; % Whatever color you want.
cMap(200:end, :) = [15, .2, .58]; % Whatever color you want.
colormap(cMap);
colorbar;