How to add transparency to a 2D colormap?
105 views (last 30 days)
Show older comments
Lukasz Handzlik
on 30 Mar 2015
Commented: Lukasz Handzlik
on 1 Apr 2015
Does anyone know, how to add transparency to 2D colormaps? I would like it to be overlaid over an image, so that both are visible. I will base the code on this one:
if true
%
data = rand(10,10);
minVal = min(min(data));
maxVal = max(max(data));
image(data,'CDataMapping','scaled');
cbar_labels = [0 0.12 0.2 0.3 0.5 0.6 0.75 0.8 1]; % user defined ranges
user_cmap = jet(8); % user defined colormap
customcmap(cbar_labels,user_cmap,[minVal maxVal])
end
Any hints will be appreciated!
Lukasz
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Colormaps 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!