Set distance between the ticks in the colorbar

15 views (last 30 days)
Hello,
I have created a contour map and a colorbar with manual ticks. The issue is with the ticks vector.
In the 1st figure, the values are equally spaced. Hence the ticks align with colors properly.
In the 2nd figure, the vectors are not spaced uequally for the 1st two and last two values. Hence, it does not align with colors.
PS: The number of colors and vector values is proper. Issue lies with the aligning only.
  3 Comments
Sandesh Dube
Sandesh Dube on 27 Oct 2020
Hi Adam,
I have tried to put tick labels separately. But they also were put at the same locations, as the ticks. And not at equal distances throughout the colorbar.
Can you illustrate the above with an example?
Adam Danz
Adam Danz on 27 Oct 2020
The tick labels will always be at the location of the ticks. That's why you have to calculate the position of the ticks correctly.
Here's an example

Sign in to comment.

Answers (0)

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!