如何在 jupyter 笔记本中将内联离线 plotly 图表输出为图像?

How can I have an inline offline plotly chart output as an image in a jupyter notebook?

我希望输出离线图表的图像,而不是交互式图表,以便生成更好的 PDF。例如替换:

pl.offline.iplot(fig)

docs 的离线部分,它在 offline.iplot 部分说:

"To embed an image of the chart, use plotly.image.ishow."

需要在线验证。

答案是创建一个帐户并使用 plotly.image.ishow,因为它不会将图片保存在他们的服务器上。