Skip to content
Advertisement

How to add colorbar to existing axis handle?

This way is easy and works:

JavaScript

But when it’s like this:

JavaScript

How do I get the colorbar on that axis? I don’t need anything fancy, just the defaults.

Advertisement

Answer

Pass the respective image and axes handles into fig.colorbar:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement