plotly / plotly.py

The interactive graphing library for Python :sparkles: This project now includes Plotly Express!
https://plotly.com/python/
MIT License
16.06k stars 2.54k forks source link

Permanent plotly marker text? #4718

Closed bufordbufordson closed 1 month ago

bufordbufordson commented 1 month ago

I have this code. I’m trying to create a map with the plotly_express markers showing a certain text (from the type column, which is included) right on top of the markers, hence the text = 'Type' and textposition = 'top center'. (See code below.) But when I run the code, the text only appears when I hover, which is the opposite of what I’m looking for. How to fix? Is it because I am missing a mapbox token?

fig = px.scatter_mapbox( daily_average_exceedances_df, lat = 'Latitude', lon = 'Longitude', color='Daily Exceedances', color_continuous_scale=px.colors.sequential.Sunset, range_color=(0,30), hover_data=['siteId'], text=daily_average_exceedances_df['Type'], ).update_layout( mapbox={"style": "carto-positron", "zoom":11}, margin={"l": 0, "r": 0, "t": 0, "b": 0} )

Thanks, Buford Bufordson

gvwilson commented 1 month ago

Hi @bufordbufordson - for tech support and "how-to" questions, please post in our community forum https://community.plotly.com/ - you'll probably get a much faster response there. Thank you - @gvwilson