我试图在和四个显示为子图的甘特图中添加相同的标题。然而我在网上发现,这只显示了第一个图表上的标题,而不是全部。我已经找到了一些关于 R 的答案,但是任何关于 python 的帮助都会很棒x-axesy-axesfigs.update_layout()
figs = make_subplots(
rows=2, cols=2,
shared_xaxes=False,
subplot_titles =('Plot 1', 'PLot 2', 'PLot 3', 'Plot 4')
)
figs.update_layout(
title="Plot Title",
xaxis_title="Miliseconds",
yaxis_title="Services",
)
for trace in fig_operable.data:
figs.add_trace(trace, row=1, col=1)
for trace in fig_dynamic.data:
figs.add_trace(trace, row=2, col=1)
for trace in fig_early.data:
figs.add_trace(trace, row=1, col=2)
for trace in fig_hmi.data:
figs.add_trace(trace, row=2, col=2)
figs.update_layout(showlegend=False, title_text="Title of charts")
figs.show()
Run Code Online (Sandbox Code Playgroud)