import pandas as pd import matplotlib.pyplot as plt df = pd.DataFrame({'height':[160,160,160,160,160,160,161,162,163,164,165,170,170,168,168,166,166,169,169,171,172,173,174,175,171,172,173,174,175,170,171,172,173,174,175], 'weight':[70,72,74,76,78,80,70,70,70,70,73,77,70,76,70,75,71,76,70,77,77,77,77,77,70,70,70,70,70,71,72,73,74,75,76]}) df.plot(x='height', y='weight', kind='scatter', marker='*', s=60, label='height-weight') #绘制散点图 # plt.figure(figsize=(8,5)) plt.show()