已知字母Z的点阵和坐标如下: 图片内容:字母Z点阵坐标图,X轴取值1-9,Y轴取值0-9,Z由三部分组成:上横(y=9,x从2到9)、对角线(x从2递增到9,y从1递增到8)、下横(y=0,x从2到9) 图片内容:matplotlib绘制字母Z的散点图效果,上横为蓝色点、对角线为橙色点、下横为绿色点
import matplotlib.pyplot as plt
x1=[2,3,4,5,6,7,8,9]
y1=[9,9,9,9,9,9,9,9]
x2=①
y2=[1,2,3,4,5,6,7,8]
x3=[2,3,4,5,6,7,8,9]
y3=[0,0,0,0,0,0,0,0]
plt.scatter(x1,y1,marker='o',s=150)
plt.scatter(x2,y2,marker='o',s=150)
plt.scatter(x3,y3,marker='o',s=150)
plt.show()