I have a problem displaying histograms in matplotlib when both histtype = 'stepfilled' and log = True options are used. I had this problem in matplotlib version 1.1.0 and I found that it is still present in version 1.2.0.
Unfortunately, I do not have permission to post images, but you can check this behavior with this simple code:
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt mu, sigma = 200, 25 x = mu + sigma*np.random.randn(10000) n, bins, patches = plt.hist(x, 50, normed=1, histtype='bar',log=True) plt.savefig("test1.png") plt.clf() n, bins, patches = plt.hist(x, 50, normed=1, histtype='stepfilled',log=True) plt.savefig("test2.png")
The first digit is displayed correctly, while in the second case with the option histtype = 'stepfilled' instead of "bar" no. Does anyone have a key?
source share