How to make a region of the colorbar completely transparent?

8 views (last 30 days)
Hello,
I was wondering if I could make a region of my colorbar be completely transparent. Here is a snippet of my code:
newmap = jet(256);
ncol = size(newmap,1);
for n = 129:180
zpos = n;
newmap(zpos,:) = [1 1 1];
end
colormap(newmap);
Instead of making the region of my colorbar from 129:180 white ([1 1 1]) is there a way to make it transparent? I can set an alpha to the overall plot but that would not make the white completely transparent. I also tried newmap(zpos,:) = 'none'; which did not work. Thank you!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!