footfalcon
footfalcon

Reputation: 641

How to format plotly title in python as bold when the title is a variable?

I know how to format the title as bold if the title is entered as a string using html tags:

layout = go.Layout(title='<b>Bold</b>')

but how do I get it to work if the title is assigned to a variable?

title = 'Bold'
layout = go.Layout(title='<b>'title'</b>')

Upvotes: 0

Views: 4822

Answers (1)

footfalcon
footfalcon

Reputation: 641

For sake of completeness, I am adding @SyntaxVoid comment as the working solution/answer. This works:

title = 'Bold'
layout = go.Layout(title='<b>'+title+'</b>')

Upvotes: 3

Related Questions