我正在使用 mplcursors 在我的折线图中添加数据标签。我面临的问题是我只能添加一个数据点。当我尝试添加另一个时,前一个数据点消失了。有没有办法添加多个数据点。请在下面查看我的代码和图片。
rcParams['figure.figsize'] = 25, 10
df2 = pd.read_excel('SS_TDH.xlsx').ffill()
sns.lineplot(x=df2['Device_ID'].astype(str)+df2['Temp(deg)'].astype(str)+'-'+df2['Supply[V]'].astype(str),
y=df2[2.4],color='r',marker='o')
sns.lineplot(x=df2['Device_ID'].astype(str)+df2['Temp(deg)'].astype(str)+'-'+df2['Supply[V]'].astype(str),
y=df2[3.07],color='b',marker='o')
plt.legend(['2.4','3.07'])
plt.ylabel('TDH',size=20)
plt.tick_params(axis='x',labelsize=10,rotation=90)
mplcursors.cursor(hover=True)
plt.show()