python-plt.scatter参数详解

import matplotlib.pyplot as plt

x = [1, 2, 3, 4, 5]
y1 = [i + 1 for i in x]
y2 = [i + 2 for i in x]

# c:颜色 marker:标记形状
plt.scatter(x, y1, c='g', marker='x')
plt.scatter(x, y2, c='r', marker='x')

# legend:对应的种类
plt.legend(('y1', 'y2'), loc='upper right')
# xlabel/ylabel:横纵坐标标注
plt.xlabel("x")
plt.ylabel("y")
# title:标题
plt.title("fun")

plt.show()

python-plt.scatter参数详解_第1张图片

你可能感兴趣的:(Map,Python)