I know this question has been asked before but I couldn't find the answer to my question so I hope to find a solution here I want to create the chart to show First day of snow vs. Last day of snow. The chart is the following:
the X axis is the year, Y axis is the day in the year that has snow. However, I want to the data label when mouse hover to show the actual date. Example: [x,y] = [140, 1873]. Data label to be '1873-11-18'. The data label comes from different column of the data frame. Here is my dataframe:
fig, ((ax1,ax2)) = plt.subplots(2,1, figsize=(12,8),constrained_layout=True)
colors = ['skyblue', 'coral', 'mediumaquamarine']
Xticks = np.arange(1880, 2021, 20)
snow.plot(x = 'Snow Year', y = ['First DOS', 'Last DOS'], color = colors, ax = ax1)
snow.plot(x = 'Snow Year', y = ['Snow length'], color = 'mediumaquamarine', ax = ax2)
sns.regplot(x='Snow Year',y='First DOS', data = snow, fit_reg=True, ax = ax1)
sns.regplot(x='Snow Year',y='Last DOS', data = snow, fit_reg=True, ax = ax1)
sns.regplot(x='Snow Year',y='Snow length', data = snow, fit_reg=True, ax = ax2)
ax1.legend(bbox_to_anchor=(1,1), loc="upper left")
ax2.legend(bbox_to_anchor=(1,1), loc="upper left")
plt.show()