我正在尝试绘制以下内容!
from numpy import *
from pylab import *
import random
for x in range(1,500):
y = random.randint(1,25000)
print(x,y)
plot(x,y)
show()
然而,我一直得到一个空白的图形(?)。为了确保程序逻辑正确,我添加了代码print(x,y)
,只是确认(x,y)对正在生成。
(x,y)对正在生成,但没有绘图,我一直得到一个空白的图形。
有什么帮助吗?
from matplotlib import pyplot as plt; plt.plot(x, y); plt.show()
。 - Eric O. Lebigot