Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Center plotly title by default

Tags:

python

plotly

I have a plotly figure which I center the title using -

fig.update_layout(
            title={
            'text' : title,
            'x':0.5,
            'xanchor': 'center'
        })

I have multiple graphs and I add this to every one of them. I wonder if I can define it in advance, e.g using config object or settings, and not do it for every chart.

like image 966
Tom Ron Avatar asked Sep 06 '25 23:09

Tom Ron


1 Answers

This works with me easily:

fig.update_layout(title_text='write a title here', title_x=0.5)
like image 195
Phoenix Avatar answered Sep 08 '25 22:09

Phoenix