这是我的密码:
import matplotlib.pyplot as plt
x_values = list(range(1,1001))
y_values = (x**2 for x in x_values)
plt.scatter(x_values,y_values,s=10)
#range of axis
plt.axis([0,1100,0,1100000])
plt.show()
每当我试图在python中通过散布方法绘制一个数字列表时,我总是会得到一个错误,即“matplotlib不支持generatore”。有什么解决办法吗
通过做
您可以创建一个生成器
将其列为一个列表并提供:
得到
见:
相关问题 更多 >
编程相关推荐