1

I am trying to have colorbar with specific range. I tried the following

h = colorbar(); 
set(h, 'ylim', [0 60]);

enter image description here

I would like to have the highest value color in 40 to be in 60 in the colorbar (stretching for the colors range), and the color in value 40 in colorbar should be the maximum value in the figure.

0

1 Answer 1

2

Before colorbar use the function caxis with the limits you want, for example,

surf(meshgrid(0:7).^2)
caxis([0, 60])
colorbar 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.