I have two quick questions about colorbars in matplotlib. The first is related to the size of the colorbar. I would like to have square axes for a plot, so I use:
However, here I find that the colorbar is as long as the original image rather than the scaled image. Is there a good way around this?
have not helped.
The second question is related to the choice of tickmarks for the colorbar. If I would like to have only say 4 ticks on colorbar, I tried:
cb.ax.xaxis.set_major_locator(MaxNLocator(4)), however, the range for the colorbar is now incorrect. Suggestions? I am using