【发布时间】:2015-10-12 07:33:08
【问题描述】:
我想保存 HTML 代码,但不显示它。我该怎么做?
【问题讨论】:
标签: python html plot save bokeh
我想保存 HTML 代码,但不显示它。我该怎么做?
【问题讨论】:
标签: python html plot save bokeh
解决方案是将对show 的调用替换为对save 的调用。
【讨论】:
使用output_file({file_name}) 而不是output_notebook()。您可以调用save 或show 方法。请记住,每次调用 save 或 show 方法时,文件都会被重写。
from bokeh.plotting import figure, output_file, save
p = figure(title="Basic Title", plot_width=300, plot_height=300)
p.circle([1, 2], [3, 4])
output_file("output_file_name.html")
save(p)
【讨论】: