title: Change Plotly Boxplot Hover Data
body: <p>I want to change the hover text and hover data for a python plotly boxplot. Instead of 5 separate hover boxes for max, q3, median, q1, and min, I want one condensed hover box for Median, Mean, IQR and date. I have played around with every &quot;hover&quot; variable with no luck. My sample code is found below.</p>
  <pre><code>import numpy as np
  import plotly.express as px
  
  lst = [['2020'], ['2021']] 
  numbers = [20 , 25]
  r = [x for i, j in zip(lst, numbers) for x in i*j]
  
  df = pd.DataFrame(r, columns=['year'])
  df['obs'] = np.arange(1,len(df)+1) * np.random.random()
  
  mean = df.groupby('year').mean()[['obs']]
  median = df.groupby('year').median()[['obs']]
  iqr = df.groupby('year').quantile(0.75)[['obs']] - df.groupby('year').quantile(0.25)[['obs']]
  
  stats = pd.concat([mean,median,iqr], axis=1)
  stats.columns = ['Mean','Median','IQR']
  tot_df = pd.merge(df,stats, right_index=True, left_on='year', how = 'left')
  
  fig = px.box(tot_df, x=&quot;year&quot;, y=&quot;obs&quot;, points=False, hover_data=['year','Mean','Median','IQR'])
  fig.show()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/TK7XG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TK7XG.png" alt="enter image description here" /></a></p>
  <p>In this case I tried to use &quot;hover_data&quot;, which does not raise an error, but also does not change the plot, as shown above. I have tried both express and graph_objects with no luck. My plotly versions is 4.9.0. Thank you!</p>