import pandas as pd
import matplotlib.pyplot as plt
from pylab import mpl
# 设置显示中文字体
mpl.rcParams["font.sans-serif"] = ["SimHei"]
document_path = r"E:\廓线数据"
ax=plt.gca()
#文件名字
filename_hs1 =['XB5', 'XB17','XB6', 'XB8', 'XB10', 'XB12', 'XB16','XB19']for i in filename_hs1:excel_path = os.path.join(document_path,i+".xlsx")data=pd.read_excel(excel_path)depth=data["水深"][0:300]S =data['盐度'][0:300]T =data['温度'][0:300]plt.plot(T, depth,label=str(i))
ax.set_ylabel('水深')
#设置x轴title
ax.set_xlabel('温度')
ax.invert_yaxis()
plt.legend()
plt.show()