Skip to main content
 首页 » 编程设计

python之plotly python plot方法启动浏览器

2025年05月04日15lyhabc

我的问题是 plotly python plot 方法

plot_url = py.plot(fig, filename='box-plot') 

自动启动网络浏览器,是否可以防止这种行为?

感谢您的回答!

请您参考如下方法:

Plotly for Python 可以配置为在 Jupyter (IPython) 笔记本中本地呈现,在您的网络浏览器中本地呈现,或在您的在线 Plotly 帐户中远程呈现。

离线模式将在本地保存一个 HTML 文件并在您的网络浏览器中打开它。

plot()接受选项:

auto_open (default=True) -- Toggle browser options
* True: open this plot in a new browser tab
* False: do not open plot in the browser, but do return the unique

plot_url = py.plot(fig, filename='box-plot', auto_open=False)