python 使用excel画图

使用pands 和 matplotlib

import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_excel("E:\Desktop\test_draw.xlsx")
print(df)


plt.plot(df["time"],df["aa"],label='a',linewidth=5,color='r',marker='*', markerfacecolor='blue',markersize=1)
plt.plot(df["time"],df["bb"],label='b',linewidth=1,color='b',marker='o', markerfacecolor='blue',markersize=1)
plt.xlabel("time")
plt.ylabel('char')
plt.title("xxx")
plt.legend()
plt.grid()
plt.show()

在这里插入图片描述

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>