I would like to set the matplotlib colorbar range. Here\'s what I have so far:
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(20)
y = np.a
Matplotlib 1.3.1 - It looks like the colorbar ticks are only drawn when the colorbar is instanced. Changing the colorbar limits (set_clim) does not cause the ticks to be re-drawn.
The solution I found was to re-instance the colorbar in the same axes entry as the original colorbar. In this case, axes[1] was the original colorbar. Added a new instance of the colorbar with this designated with the cax= (child axes) kwarg.
# Reset the Z-axis limits
print "resetting Z-axis plot limits", self.zmin, self.zmax
self.cbar = self.fig.colorbar(CS1, cax=self.fig.axes[1]) # added
self.cbar.set_clim(self.zmin, self.zmax)
self.cbar.draw_all()