Also posted here: https://stackoverflow.com/questions/68541008/plotly-scattermapbox-text-font-family-does-not-change
I want to add text to my map in a specific font. Even when I tested with basic HTML-fonts, the text in the map wouldn’t change. However, I could change the hover font. What went wrong? Or is it a bug?
fig = go.Figure(go.Scattermapbox(
lat=[51.555606],
lon=[5.090819],
mode="markers+text",
showlegend=False,
text=['Test'],
textposition='top right',
textfont=dict(size=25, color='black', family='Courier New'),
hoverlabel=dict(font=dict(family='Courier New', size=25)),
marker=dict(size=20)))
fig.update_layout(mapbox=dict(zoom=11.5, center={"lat": 51.57, "lon": 5.07}, accesstoken=token))
Output:
Output figure with hover, which uses Courier New: