Python我可以在jupyter笔记本外显示bokeh绘图吗?

问题描述 投票:0回答:1

我一直在使用Bokeh使用Bokeh在地图上绘制数据。

有没有办法在jupyter笔记本之外使用此库?

类似于在Pychram中并将图保存到HTML文件。

python bokeh
1个回答
1
投票

Bokeh可以使用file_html()功能为Bokeh文档生成完整的HTML页面。您可以参考Embedding Plots and Apps了解更多详情。

from bokeh.plotting import figure
from bokeh.resources import CDN
from bokeh.embed import file_html

plot = figure()
plot.circle([1,2], [3,4])

html = file_html(plot, CDN, "my plot")
© www.soinside.com 2019 - 2024. All rights reserved.