如何将其他 jupyter notebook 中的 plotly plots 整合到新的 notebook 中?
How to integrate plotly plots from other jupyter notebooks into a new notebook?
目前我有几个 jupyter 笔记本,其中有不同的情节。我可以将每个笔记本导出为 html,并且工作正常。我想要的是创建一个摘要笔记本,其中包含来自不同笔记本的所有重要图表。这可能吗,如果可以的话怎么办?
非常感谢。
如果您还没有这样做,您可以使用 .write_html
功能导出每个图(而不是整个笔记本)。类似于:
来自笔记本#1:
fig.write_html(/figures/fig1.html)
...
来自笔记本#N:
fig.write_html(/figures/figN.html)
然后在一个新笔记本中,您可以加载所有保存为基于 this answer 的 html 的 Plotly 图形。
类似于以下内容:
新笔记本:
from IPython.display import HTML
# in a new cell:
HTML(filename='fig1.html')
#...
#...final cell:
HTML(filename='figN.html')
目前我有几个 jupyter 笔记本,其中有不同的情节。我可以将每个笔记本导出为 html,并且工作正常。我想要的是创建一个摘要笔记本,其中包含来自不同笔记本的所有重要图表。这可能吗,如果可以的话怎么办?
非常感谢。
如果您还没有这样做,您可以使用 .write_html
功能导出每个图(而不是整个笔记本)。类似于:
来自笔记本#1:
fig.write_html(/figures/fig1.html)
... 来自笔记本#N:
fig.write_html(/figures/figN.html)
然后在一个新笔记本中,您可以加载所有保存为基于 this answer 的 html 的 Plotly 图形。
类似于以下内容:
新笔记本:
from IPython.display import HTML
# in a new cell:
HTML(filename='fig1.html')
#...
#...final cell:
HTML(filename='figN.html')