scatter散点图

列表用的是”()“没用”[]“
”,“总是写成“.“

import matplotlib.pyplot as plt

x_value = list(range(1,1001))
y1_value = [x*1000 for x in x_value]
y2_value = [x**2 for x in x_value]
plt.scatter(x_value,y1_value,c=y1_value,cmap = plt.cm.Blues,
            edgecolor = 'none',s=10)
plt.scatter(x_value,y2_value,c=y2_value,cmap = plt.cm.Reds,
            edgecolor = 'none',s=10)
plt.axis([0,1100,1,1100000])

plt.show()

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43139613/article/details/82794164
今日推荐