Black Lives Matter. Please consider donating to Black Girls Code today.

Plotly express. How to disable part of hover text


How do I disable the default text displayed in the tooltip? I mean the values of latitude and longitude are showing up when I hover over a point on the map. I am using px.scatter_mapbox(). Any solutions?

Welcome to the community @focal_fossa
Try this link. It explains all you can do with the hover.

Thank you for the link. It took a few attempts, but I managed to figure it out. I just needed to pass False for the columns that I did not want displayed.

hover_data={'latitude':False, 'longitude':False, 'City':True}

latitude, longitude and City are the names of the columns in my dataframe.

1 Like