【发布时间】:2020-06-01 22:58:01
【问题描述】:
我希望从 matplotlib 中绘制直方图,特别是 x1 变量。但是,我无法导航直方图。目前,我有:
43: h = plt.hist(y[:, 0])
44: h.plot(y[:, 0])
45: h.set_xlabel('$x_1$')
46: plt.show()
我收到错误:文件“/Users/scottdayton/PycharmProjects/Uncertainty Research/lorenz.py”,第 44 行,在 h.plot(y[:, 0]) AttributeError: 'tuple' 对象没有属性 'plot'
如何获得直方图来绘制我得到的值? (y[:, 0])
【问题讨论】:
标签: python matplotlib plot histogram attributeerror