# How can I show a selected column value on hover over points

**URL:** <https://community.plotly.com/t/how-can-i-show-a-selected-column-value-on-hover-over-points/70257>\
**Category:** 📊 Plotly Python\
**Created:** [November 25, 2022, 4:16pm UTC](https://community.plotly.com/t/how-can-i-show-a-selected-column-value-on-hover-over-points/70257 "2022-11-25T16:16:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yogi\_dhiman](https://avatars.discourse-cdn.com/v4/letter/y/f04885/32.png) [@yogi\_dhiman](https://community.plotly.com/u/yogi_dhiman)\
**Post date:** [November 25, 2022, 4:16pm UTC](https://community.plotly.com/t/how-can-i-show-a-selected-column-value-on-hover-over-points/70257/1 "2022-11-25T16:16:01Z")

</div>

How can i show a selected variable value on hover over points on LHS and hide all other hover\_data values  
( Note not the value of y axis )

> **[Violin](https://plotly.com/python/violin/)**
>
> Over 12 examples of Violin Plots including changing color, size, log axes, and more in Python.

import plotly.express as px

df = px.data.tips()  
fig = px.violin(df, y=“total\_bill”, box=True, # draw box plot inside the violin  
points=‘all’, # can be ‘outliers’, or False  
)  
fig.show()

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/1/1/11c841998bb729e06e00e11f41e8fb500bf19ba1.png)

---

<div class="post-metadata">

**Author:** ![yogi\_dhiman](https://avatars.discourse-cdn.com/v4/letter/y/f04885/32.png) [@yogi\_dhiman](https://community.plotly.com/u/yogi_dhiman)\
**Post date:** [November 26, 2022, 10:07am UTC](https://community.plotly.com/t/how-can-i-show-a-selected-column-value-on-hover-over-points/70257/2 "2022-11-26T10:07:22Z")

</div>

Answering myself but stuck with annotation offset because x axis is not given

annotate\_dict = {0: [‘var1’, 1.946],  
1: [‘var2’, 1.8941],  
2: [‘var3’, 1.867],  
3: [‘var4’, 1.72],  
4: [‘var5’, 1.696],  
5: [‘var6’, 1.668]}

boxplot\_fig = px.strip(df,y=‘score’,color=‘stage’,color\_discrete\_map = {-3:‘red’,-2:‘orange’,-1:‘olive’,0:‘grey’,1:‘orange’,2:‘olive’,3:‘forestgreen’},stripmode=‘overlay’,hover\_name=‘variable’,hover\_data=[‘stage’,‘score’,‘thrust’])

boxplot\_fig.update\_layout(showlegend=False,width=500, height=800)

for i in annotate\_dict:  
boxplot\_fig.add\_annotation(y=annotate\_dict[i][1],  
text=annotate\_dict[i][0],  
showarrow=True,  
arrowhead=1)
