即使我創(chuàng)建了兩個(gè)分區(qū),第二個(gè)分區(qū)中的文本也會(huì)顯示在第一個(gè)分區(qū)中。如下圖所示——我用來制作它的代碼 -###### Runs Distributionshtml.H2("Runs Distributions"),# Histogram of Runs Distributionshtml.Div( [ html.Div( [ html.P( "We can see that the distribution is right skewed. Many " "players makes low or medium runs, while few players makes " "lots of runs. The median of this distribution is 126 which " "means that 50% of the players makes less than 126 runs and " "50% more than this. 406 is the 90th percentile, meaning 90% " "of the players makes less than 406 runs. So, any players who " "is making more than 400 runs in a season is really doing well. " "They are in the top 10%." ) ], style={ "width": "35%", "display": "inline-block", "margin-top": "60px", }, ), html.Div( [dcc.Graph(id="runs-dist-plot", figure=runs_dist_plot)], style={"width": "65%", "float": "right", "display": "inline-block"}, ), ], style={"margin": "40px"},),# Kernal density estimation of Runs distributionshtml.Div( [ html.Div( [html.P("Gonna Write something.")], style={ "width": "35%", "display": "inline-block", "margin-top": "60px", }, ), html.Div( [dcc.Graph(id="runs-kde-plot", figure=runs_kde_plot)], style={"width": "65%", "float": "right", "display": "inline-block"}, ), ], style={"margin": "40px"},),無法理解為什么會(huì)發(fā)生這種情況?一種方法是調(diào)整第二部分中段落標(biāo)簽的頁邊距樣式,但我有很多圖表要在這些圖表下面繪制。因此,通過反復(fù)試驗(yàn)來改變每個(gè)圖的值將是非常乏味的。有沒有辦法為將來的情節(jié)設(shè)置一次。
1 回答

慕神8447489
TA貢獻(xiàn)1780條經(jīng)驗(yàn) 獲得超1個(gè)贊
我在本地使用圖形的一些占位符運(yùn)行此程序,并且能夠使用第一個(gè)分區(qū)的高度值將文本與第二個(gè)圖形一起下載。您所在的地方:
style={"margin": "40px"},
我改為:
style={"margin": "40px", "height": 500},
如果您想在第二個(gè)分區(qū)內(nèi)對(duì)齊文本,則需要從框的頂部進(jìn)行調(diào)整。
我處理所有這些問題的首選方法是使用flexbox,但這需要進(jìn)行更多更改并刪除inline-block
您所擁有的,因此我在這里只進(jìn)行了最小的更改。
添加回答
舉報(bào)
0/150
提交
取消