MATLAB Answers

Set interval for colorbar

13 views (last 30 days)
Behzad Navidi
Behzad Navidi on 30 May 2020
Answered: Ameer Hamza on 30 May 2020
Dear all, I used
colormap bone
colorbar
But I want to have a color bar like this (intervals splite colors like this):
I searched and used this:
colorbar('Ticks', 0:0.1:1);
But it does not work and doesn't change anything. Any advice is highly appreciated.
Thank you in advance

  0 Comments

Sign in to comment.

Accepted Answer

Ameer Hamza
Ameer Hamza on 30 May 2020
Try this
intervals = 0:0.1:1;
clrs = bone(2*numel(intervals)-2);
colormap(clrs);
colorbar

  0 Comments

Sign in to comment.

More Answers (0)

Products


Release

R2020a

Translated by