我需要用换行符在 plotly 上创建一个图。最好顶部的文本大于第二行,但不是必需的。
fig.update_layout(
title=go.layout.Title(
text=title,
xref="paper",
x=0.5,
),
Run Code Online (Sandbox Code Playgroud)
对于我尝试过的标题
title = "Hello \n World"
title = "Hello" + "\n" + "World"
title = "$Hello \\ World$"
title = "$Hello \newline World$"
Run Code Online (Sandbox Code Playgroud)
所有运行都没有错误,但换行符被忽略。
我不确定如何实现这一点。感谢您的帮助。