英文:
plotly subplots: is it possible to have one subplots occupy multiple columns or rows
问题
我正在尝试使用Plotly子图在一个图上绘制3个图。自然地,我可以只用3行,但我想要前两个图并排,另一个图被拉长。总体上,我想要在图片上获得以下布局(我用画图软件绘制的):
是否有可能实现这个布局,如果可以,如何实现?
英文:
I am trying to have 3 plots on one figure using plotly subplots.
Naturally, I could do just 3 rows but I am trying to have first two figures side-by-side and another being stretched out. Overall I am trying to get a layout on the picture (that I made with paint):
Is it possible and if yes how can I achieve this ?
答案1
得分: 0
从文档示例中,使用规格定义多列跨度:
from plotly.subplots import make_subplots
import plotly.graph_objects as go
fig = make_subplots(
rows=2, cols=2,
specs=[[{}, {}],
[{"colspan": 2}, None]],
subplot_titles=("第一个子图", "第二个子图", "第三个子图"))
英文:
From the documentation examples, using specs to define multi col span:
from plotly.subplots import make_subplots
import plotly.graph_objects as go
fig = make_subplots(
rows=2, cols=2,
specs=[[{}, {}],
[{"colspan": 2}, None]],
subplot_titles=("First Subplot","Second Subplot", "Third Subplot"))
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论