【发布时间】:2015-12-11 11:25:28
【问题描述】:
我在 matplotlibFile 中绘制图形时遇到以下错误“
<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 2515, in bar
ret = ax.bar(left, height, width=width, bottom=bottom, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 4951, in bar
width *= nbars
MemoryError
我的代码如下所示:
import matplotlib.pyplot as plt
x = [56508490, 56508490]
max = 56508490
plt.bar(range(0,max), x) #-> error line
#plt.show()
附: :我只需要在变量中使用上述值
【问题讨论】:
-
你能用 xrange 代替 range 吗?
标签: python matplotlib matplotlib-widget