Closed
Description
Bug report
Bug summary
It would be nice if the colorbars changed their number of ticks if the colorbar gets small.
Code for reproduction
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
X = np.random.rand(32,32)*20.
fig, ax = plt.subplots()
pc = ax.pcolormesh(X)
fig.colorbar(pc)
plt.show()
fig, ax = plt.subplots(figsize=(4, 1.))
pc = ax.pcolormesh(X)
fig.colorbar(pc)
plt.show()
Actual outcome
Expected outcome
The full sized plot has 7 y-ticks and 7 colorbar ticks. Whichs is fine.
If I make the plot much smaller (as can happen if I have a bunch of subplots), then the y-axis decreases its number of ticks, but the colorbar doesn't.
No idea how easy this is, and I don't think its a must-do (we can use a manual locator), but it does seem the default should be that the colorbar gets treated as well as the y-axis.
Matplotlib version
- Master