我创建了一个子地块,老实说,在plotly文档中不清楚如何使这些标题更大
https://plotly.com/python-api-reference/generated/plotly.subplots.make_subplots.html
这是供参考的文档,他们讨论了设置x_轴标题和y_轴标题。我确实这么做了,但我似乎找不到修改的方法
fig = make_subplots(
rows=6, cols=4,
subplot_titles=subplot_titles,
y_title='Distance (Å)',
x_title='Resid ID'
)
positions = [
[1, 1], [1, 2], [1, 3], [1, 4],
[2, 1], [2, 2], [2, 3], [2, 4],
[3, 1], [3, 2], [3, 3], [3, 4],
[4, 1], [4, 2], [4, 3], [4, 4],
[5, 1], [5, 2], [5, 3], [5, 4],
[6, 1], [6, 2], [6, 3], [6, 4],
]
for i in range(0, len(segids)):
fig.add_trace(
go.Scattergl(
x=resid_titles,
y=list(copy[segids[i]].values()),
line=dict(color=colors[0]),
),
row=int(positions[i][0]),
col=int(positions[i][1])
)
# Set title
fig.update_layout(title_text="Average O5-O3 Distance Per Resid Per Chain")
fig.update_layout(
title_font_family="Arial",
title_font_color="Black",
title_font=dict(size=44, family='Courier'),
)
# Remove the Legend
fig.update_layout(showlegend=False)
fig.update_xaxes(
ticks="outside",
tickwidth=2,
tickcolor='black',
tickfont=dict(family='Arial', color='black', size=22),
title_font=dict(size=44, family='Arial'),
range=[1, 9],
)
fig.update_yaxes(
ticks="outside",
tickwidth=2,
tickcolor='black',
tickfont=dict(family='Arial', color='black', size=22),
title_font=dict(size=44, family='Arial'),
range=[2, 5]
)
我试过使用他们的update_xaxes功能,但没有用
“剩余ID”和“距离”轴标题->;我想要大一点的,也许可以改变颜色。有没有一种方法可以实现这一点,我只是错过了
这里有一张图片供参考
答案是:
您可以使用:
一些细节:
基于plotly文档中的子地块示例,以下代码段
…将扭转这一局面:
。。。为此:
完整代码:
相关问题 更多 >
编程相关推荐