使用Python将鼠标悬停在点图中的点时的详细说明

时间:2019-06-17 05:05:32

标签: python matplotlib data-visualization

我有一个点图,周为x轴,分数为y轴。将鼠标悬停在该图上的某个点时,我需要弹出一个观察点,该观察点将消失。有可能吗?

fig,ax1= plt.subplots(figsize=(12,10))
weekfig = pd.DataFrame(data.groupby(["Week","State"],sort=True)["Score"].mean()).reset_index()
sn.pointplot(x=weekfig["Week"], y=weekfig["Score"],hue=weekfig["State"], data=weekfig, join=True,ax=ax1)
ax1.set(xlabel='Week', ylabel='Score',title="Average Score By Week across each state",label='big')
ax1.axhline(8.5, ls='--')
fig.savefig('C:/Users/Joseph Lionel/Desktop/Ruban Bridge/Amazon/Analyse/Average Score by Week across State.png')
plt.show() 

0 个答案:

没有答案