When creating colorbars using the "ColorbarBase" object and adding ticks with the "set_yticklabels" method matplotlib only displays up to half the values specified in the "ticks" list. This only started happening after I upgraded to the latest matplotlib version.
Here is a short code to test it:
import matplotlib.pyplot as plt
import matplotlib as mpl
fig = plt.figure(1)
cax = fig.add_axes([0.8, 0.15, 0.03, 0.72])
ticks = range(11)
cbar = mpl.colorbar.ColorbarBase(cax, cmap='rainbow', orientation='vertical')
cbar.ax.set_yticklabels(ticks)
plt.show()
Using matplotlib version 2.1.0 I get a colorbar with ticks that go from 1 to 5, meanwhile with matplotlib version 1.4.3 I get the correct figure with ticks that go from 1 to 10.
I can do a dirty fix by increasing the tick range by two, but I would prefer this not to happen. Any tips on what could be going on?
