当我将 y 轴更改为对数刻度时,为什么阴影在错误的位置?
如果我删除对数刻度,它们在 histogram-columns 内部,在对数刻度外部
from scipy.stats import norm
import matplotlib.mlab as mlab
import numpy as np
import matplotlib.pyplot as plt
data=np.genfromtxt(FileName)
Flow=data[:,1]
Max=np.amax(Flow)
Min=np.amin(Flow)
n, bins=np.histogram(Flow, 15)
n, bins, patches = plt.hist(Flow, 15, color= 'b',log=True, histtype='step',hatch='/')
(mu, sigma) = norm.fit(Flow)
y = mlab.normpdf( bins, mu, sigma)
plt.xlabel('Flow (m3/s)')
plt.ylabel('Number of Observations')
plt.title(r'$\mathrm{Flow:}\ \mu=%.3f,\ \sigma=%.3f, Min=%.3f, Max=%.3f$' %(mu, sigma, Min, Max))
plt.show()