AttributeError: Unknown property density

本秂侑毒 提交于 2019-12-23 08:04:15

问题


I am trying to get a hold of SciPy, but I am stuck with Unknown property density error, even though I copied the whole code from official SciPy documentation.

This part worked fine:

x = np.linspace(norm.ppf(0.01), norm.ppf(0.99), 100)
ax.plot(x, norm.pdf(x), 'r-', lw=5, alpha=0.6, label='norm pdf')

rv = norm()
ax.plot(x, rv.pdf(x), 'k-', lw=2, label='frozen pdf')

r = norm.rvs(size=1000)

But the following part gives me the AttributeError: Unknown property density:

ax.hist(r, density=True, histtype='stepfilled', alpha=0.2)
ax.legend(loc='best', frameon=False)
plt.show()

来源:https://stackoverflow.com/questions/51368471/attributeerror-unknown-property-density

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!