我有一张Excel表格,上面有一些球员的身高/体重/年龄等.我正在try 制作一个基本的图表,在这里我可以显示平均身高/体重比,并将x轴从低到高排序?对不起,我只是个初学者
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
var = pd.read_excel("C:\Program Files\currentnbaplayerslist.xlsx")
print(var)
x = list(var['Height'])
y = list(var['Weight'])
plt.figure(figsize=(10,10))
plt.style.use('ggplot')
plt.scatter(x,y,marker="o",s=100,edgecolors="white",c="green")
plt.title("NBA players' height/weight")
plt.xlabel("Height")
plt.ylabel("Weight")
plt.gcf().autofmt_xdate()
plt.show()