如何在笔记本电脑里让剧情表达身材变高?

问题描述 投票:0回答:0

来自这个小项目https://github.com/bkontonis/Plot-PostCodes-on-Interactive-Map-Using-Python/blob/master/Plot%20on%20Map.ipynb

fig = px.scatter_mapbox(post_df, lat="latitude", lon="longitude", zoom=3, height=300)
fig.update_layout(mapbox_style="open-street-map")
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()

在单元格的结果空间中使用 plotly 绘制世界地图。

如何在 Google colab 中使这个图形高三倍?

我试过了

from IPython.display import Javascript
display(Javascript('''google.colab.output.setIframeHeight('1000px')'''))
fig = px.scatter_mapbox(post_df, lat="latitude", lon="longitude", zoom=3, height=300)
fig.update_layout(mapbox_style="open-street-map")
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()

这似乎确实使单元格变高了(不过最多只能达到 1000 像素,遗憾的是我无法让它做得更多)

但是这个图看起来只有500px那么高,下面还有很多空白

python plotly google-colaboratory
© www.soinside.com 2019 - 2024. All rights reserved.