我正在使用Bokeh来产生show
方法的包含图形的超文本标记语言代码,这个方法在打开默认浏览器时结束。
我想保存HTML代码,而不显示它。我该怎么做呢?
发布于 2015-07-22 20:17:20
解决方案是将对show
的调用替换为对save
的调用。
发布于 2017-08-10 02:43:10
使用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)
https://stackoverflow.com/questions/31562898
复制相似问题