Matplotlib 错误栏放置不正确
我有以下变量:
m = array(['2016-02-03T06:35:00.000000000', '2016-03- 07T12:09:00.000000000',
'2016-04-05T07:57:00.000000000', '2016-05-03T10:29:00.000000000',
'2016-05-30T19:23:00.000000000', '2016-08-11T05:03:00.000000000',
'2016-09-06T04:27:00.000000000'], dtype='datetime64[ns]')
n = array([9.60257044e+05, 2.73061146e+05, 6.30219177e+04, 2.18310433e+07,
1.25728987e+04, 1.21189090e+05, 1.20494747e+06])
o = array([1.10110070e+06, 3.19370657e+05, 4.99755918e+04, 3.26636779e+07,
1.89902834e+04, 1.16384062e+05, 1.07328724e+06])
在尝试使用以下代码在 matplotlib 中绘制误差条时:
plt.scatter (m, n)
plt.errorbar (m, n, yerr = o)
I have the following variables:
m = array(['2016-02-03T06:35:00.000000000', '2016-03- 07T12:09:00.000000000',
'2016-04-05T07:57:00.000000000', '2016-05-03T10:29:00.000000000',
'2016-05-30T19:23:00.000000000', '2016-08-11T05:03:00.000000000',
'2016-09-06T04:27:00.000000000'], dtype='datetime64[ns]')
n = array([9.60257044e+05, 2.73061146e+05, 6.30219177e+04, 2.18310433e+07,
1.25728987e+04, 1.21189090e+05, 1.20494747e+06])
o = array([1.10110070e+06, 3.19370657e+05, 4.99755918e+04, 3.26636779e+07,
1.89902834e+04, 1.16384062e+05, 1.07328724e+06])
while trying to plot error bar in matplotlib using the following code:
plt.scatter (m, n)
plt.errorbar (m, n, yerr = o)
the errorbar is plotted in the horizontal axis not on the vertical axis. What may be the possible reasons behind this and how to overcome this?
The plot is shown below
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论