7月
29
matplotlib教程:散点图
import matplotlib.pyplot as plt
height = [161, 170, 182, 175, 173, 165]
weight = [50, 58, 80, 70, 69, 55]
# s=20 设置大小,设置的设置的是面积,而不是直径
# c='b' 设置颜色
# marker='o' 设置点的形状
# alpha=1 透明度
plt.scatter(height, weight, s=100, c='r', marker='<', alpha=0.5)
plt.show()