第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Plot.ly:共享 X 軸的子圖的不同高度

Plot.ly:共享 X 軸的子圖的不同高度

狐的傳說 2021-07-06 16:00:00
背景具有相同高度 (?) 的不同子圖 (?)我可以創(chuàng)建一個帶有共享 X 軸的子圖(示例改編自Plot.ly doc),子圖之間有適當(dāng)?shù)姆指?,并且您可以通過subplot_titles以下方式為每個子圖插入特定標(biāo)題:from plotly import toolsimport plotly.plotly as pyimport plotly.graph_objs as gotrace1 = go.Scatter(    x=[0, 1, 2],    y=[10, 11, 12])trace2 = go.Scatter(    x=[2, 3, 4],    y=[100, 110, 120],)trace3 = go.Scatter(    x=[3, 4, 5],    y=[1000, 1100, 1200],)fig = tools.make_subplots(rows=3, cols=1, specs=[[{}], [{}], [{}]],                          shared_xaxes=True, shared_yaxes=True,                          vertical_spacing=0.1, subplot_titles=('subtitle 1',                           'subtitle 2', 'subtitle 3'))fig.append_trace(trace1, 3, 1)fig.append_trace(trace2, 2, 1)fig.append_trace(trace3, 1, 1)fig['layout'].update(height=600, width=600, title='Subplots with Shared X-Axes')py.plot(fig, filename='subplots-shared-xaxes')
查看完整描述

1 回答

?
慕絲7291255

TA貢獻(xiàn)1859條經(jīng)驗(yàn) 獲得超6個贊

Kully 在PR #1245 中解決了這個錯誤,并dash v3.4.0.

http://img1.sycdn.imooc.com//60f7ddba0001573a05260506.jpg

以下代碼 - 僅使用 3 個子圖row_width=[0.2, 0.4, 0.2]- 因此應(yīng)該可以完美運(yùn)行:


from plotly import tools

import plotly.plotly as py

import plotly.graph_objs as go


trace1 = go.Scatter(

    x=[0, 1, 2],

    y=[10, 11, 12]

)

trace2 = go.Scatter(

    x=[2, 3, 4],

    y=[100, 110, 120],

)

trace3 = go.Scatter(

    x=[3, 4, 5],

    y=[1000, 1100, 1200],

)

fig = tools.make_subplots(rows=3, cols=1,

                          shared_xaxes=True,

                          vertical_spacing=0.1,

                          subplot_titles=('subtitle 1', 'subtitle 2', 'subtitle 3'),

                          row_width=[0.2, 0.4, 0.2]

                         )


fig.append_trace(trace1, 3, 1)

fig.append_trace(trace2, 2, 1)

fig.append_trace(trace3, 1, 1)


fig['layout'].update(height=600, width=600, title='Subplots with Shared X-Axes')

go.FigureWidget(fig)


查看完整回答
反對 回復(fù) 2021-07-21
  • 1 回答
  • 0 關(guān)注
  • 463 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號