I typed this up last night then as I was about to submit it I figured it out. Submitting in case anyone else needs it.
I am plotting meteorological values for every hour for multiple days on basemap.
I want to keep the same values of the colorbar at all times for each map. Lets say from 0-10 for each plot.
Sometimes the values are all very close to zero and others they range from 0-10.
for file in files:
ncfile = Dataset(file)
cbarticks=np.arange(0.0,10.0,0.5)
bm.contour(x, y, to_np(energyproduction), 10, colors="black",vmin=0,vmax=10.0)
bm.contourf(x, y, to_np(energyproduction), 10,cmap = get_cmap('jet'),vmin=0,vmax=10.0)
plt.colorbar(shrink=.62,ticks=cbarticks)
plt.show()
I have it set so that the min and max values are always 0 and 10. And that the ticks are always 0-10 by increments of 0.5. How can I force the colorbar to stay the same.
I would prefer that the colorbar always has the same range of