Closed
Description
I often create log-scaled pcolormesh plots on my (university) computer and frequently encounter an issue: whenever I plot a colorbar using extend='both'
or extend='min'
and a LogNorm with vmin < 1.0, the bottom triangle of the colorbar stays white, no matter what colormap I use.
Here is a piece of code that recreates the problem and also shows an example where the colorbar looks like it should (the difference is that vmin >= 1.0).
import matplotlib as mpl
import matplotlib.pyplot as plt
norm0 = mpl.colors.LogNorm(vmin=1.0, vmax=1000.0)
norm1 = mpl.colors.LogNorm(vmin=0.1, vmax=1000.0)
fig, axs = plt.subplots(1,2)
# no problem here
mpl.colorbar.ColorbarBase(axs[0], norm=norm0, orientation='vertical', extend='both')
# bottom triangle section of color bar stays white
mpl.colorbar.ColorbarBase(axs[1], norm=norm1, orientation='vertical', extend='both')
plt.show()
I am using matplotlib version 1.2.1 (and I have also recreated the problem in 1.3.1). If this apparent bug has been fixed in later versions, is there an easy workaround to fill the triangle? Unfortunately I cannot easily update the software on university computers.