From other questions about this (in R though) I understood that you should be able to use HTML in (some?) text elements in Plotly. However, if I try this to get a new line in a text I add to my plot it will simply display the html tag as text and not 'parse' it. I also tried adding '\n' but that just gets ignored.
The code for the trace I'm using;
trace = go.Scattergl(
x=[0.5],
y=[4.5],
text=['A: {} <br> B: {}\nC: {}\nD: {}'.format(a, b, c, d)],
mode='text'
)
Other than that I'm using the 'standard' code to generate the graph;
traces = [trace]
layout = {
'xaxis':{
'range':[0,7],
'showgrid': False,
},
'yaxis':{
'range':[0,7],
'showgrid': False,
},
}
fig = dict(data=traces, layout=layout)
plot(fig)
How can I add a new line in this situation?
<br>
now works for the text column for me – Burtonburty