【发布时间】:2023-04-04 10:21:01
【问题描述】:
我正在使用此代码在一个图中绘制两个图,但我不知道如何从底部给图形留出空间。
def visualize_trends(df, features, titles, fig_title, fn, vs = 0.18, h = 1000, w = 800):
trace0 = go.Scatter(
x = df[features[0]],
y = df['Past_Developers_Count'],
mode = 'lines+markers',
name = 'Past',
)
trace1 = go.Scatter(
x = df[features[1]],
y = df['Future_Developers_Count'],
mode = 'lines+markers',
name = 'Future',
)
fig = tools.make_subplots(rows = 2, cols = 1, vertical_spacing = vs, subplot_titles = titles)
fig.append_trace(trace0, 1, 1)
fig.append_trace(trace1, 2, 1)
fig['layout'].update(height = h, width = w, paper_bgcolor = 'rgb(233,233,233)', title = fig_title)
py.iplot(fig, filename = fn)
输出:
在我使用vertical_spacing 给两个图表之间留出空间时,是否有任何参数可以留出空间?
【问题讨论】: