How to bold text for Scattergeo maps?

I’m building a map using Scattergeo (5.18.0), and I’m trying to set the marker text to bold. When I try to set to bold, I get ‘Bad property Path: weight.’ It doesn’t seem like it’s included as property of textfont even though the documentations shows that it does? plotly.graph_objects.Scattergeo — 5.22.0 documentation Layout in Python

        fig = go.Figure(data=go.Scattergeo(    
            lon = df['long'],
            lat = df['lat'],        
            text = df['text'],           
            textfont = dict(
                size = self.textfont_size,
                family= self.text_font_family,
                color = self.text_color,
                weight = 'bold'
            ),
            mode = 'markers+text',
            marker = dict(                
                size = self.marker_size, 
                color = df['color'],                
            )                                      
        ))

Anyone know how I can set the marker text to be bold?

weight = ‘bold’ appears to be new in Plotly 5.22, so I think you’ll need to upgrade to that

See:

1 Like

I updated to 5.22, but I’m still getting the same error. I even destroyed and rebuilt the venv. Any advice?

The (self-contained) code below, adapted from the doc, works for me (plotly==5.22.0). Does this work in your environment?

import plotly.graph_objects as go
import pandas as pd

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2011_february_us_airport_traffic.csv')
fig = go.Figure(data=go.Scattergeo(
        lon = df['long'],
        lat = df['lat'],
        text = df['iata'],
        mode = 'text',
        textfont={'weight':'bold'}
        ))
fig.show()

Ahh seems to work now after I updated Plotly on my machine, but doesn’t seem to work when it’s just updated on my venv. Weird.