MATLAB Answers

Same colormap with colorbar which has two axes

10 views (last 30 days)
Jocelino Rodrigues
Jocelino Rodrigues on 2 Aug 2019
Answered: Rik on 13 Aug 2019
I was wondering if it would be possible to have a colorbar with two variables (one on each side of the colorbar)?
I.e. if you take this Colorbar for example, I would like to also have different values on the left side of the colorbar for a different variable which shares the same units.
I hope my question makes sense!


Sign in to comment.

Answers (2)

John Doe
John Doe on 2 Aug 2019

  1 Comment

Jocelino Rodrigues
Jocelino Rodrigues on 3 Aug 2019
Unfortunately, that is not what I was looking for.
I wanted one colormap with a colorbar with two axes (two variables) where I get to pick the ticks for each of the variables on either side of the colorbar.
Hope that clarifies things?

Sign in to comment.

Rik on 13 Aug 2019
You can add a second tick row on the right side of the colorbar using the code below.
'YTick',1:10,'YLim',[1 10],...


Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by