You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like the text "shadow" parameter (here in the doc) is missing for go.Scattermap objects.
Without this parameter, we are unable to create visible labels on maps: this is the same problem as report here.
Here is an example of the problem and why border/shadow is required:
Here is a minimum reproducible code
import plotly.graph_objects as go
# Sample data
data = {
"label": ["New York", "Los Angeles", "Chicago"],
"latitude": [40.7128, 34.0522, 41.8781],
"longitude": [-74.0060, -118.2437, -87.6298]
}
# Create a Scattermapbox trace
go.Figure(
go.Scattermap(
lat=data["latitude"],
lon=data["longitude"],
text=data["label"],
textfont={
"color": "white",
"size": 12,
#"shadow": "1px 1px 1px black" # THIS IS THE ISSUE
},
mode="text",
)
)
# Update layout to include a map style and center
fig.update_layout(
map=dict(
style="open-street-map",
center=dict(lat=37.0902, lon=-95.7129), # Centered over the USA
zoom=3
),
margin={"r":0,"t":0,"l":0,"b":0}
)
fig.show()
Result :
This time the labels are white and require black shadow/border to be visible.
Plotly version: 5.24.0
python version: 5.11.11
The text was updated successfully, but these errors were encountered:
Hello,
First, thank you for your work.
It seems like the text "shadow" parameter (here in the doc) is missing for
go.Scattermap
objects.Without this parameter, we are unable to create visible labels on maps: this is the same problem as report here.
Here is an example of the problem and why border/shadow is required:

Here is a minimum reproducible code
Result :

This time the labels are white and require black shadow/border to be visible.
Plotly version: 5.24.0
python version: 5.11.11
The text was updated successfully, but these errors were encountered: