Plotly怎么再图像左上方添加多个标题
我想在图形上方添加一个如图所示的副标题,有什么办法吗? 我只能把文本添加到图像里面,不能显示在上方,大家有没有好的方法啊? 谢谢!
我的代码:
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Scatter(x=[1, 2, 3], y=[4, 5, 6]))
fig.update_layout(
title = dict(
text='Main Title',
x=0.5,
xanchor='center',
yanchor='top',
font=dict(
color='red',
size=24
),
),
)
fig.add_annotation(
xref='x domain',
yref='y domain',
x = 0,
y=1,
text='这是我添加的',
showarrow=False,
font=dict(
color='blue',
size=18
),
)
fig.show()
I know nothing about plotly, but try to find the answer for you
Maybe it is not the best answer, but work.