简体   繁体   English

Python 我可以在 jupyter notebook 外展示散景绘图吗?

[英]Python can i present bokeh plotting outside jupyter notebook?

I've been using bokeh to plot data on a map using bokeh.我一直在使用散景在地图上使用散景绘制数据。

Is there a way to work with this library outside jupyter notebook?有没有办法在 jupyter notebook 之外使用这个库?

Something like in Pychram and saving the plot to HTML file.类似于 Pychram 并将绘图保存到 HTML 文件。

Bokeh can generate complete HTML pages for Bokeh documents using the file_html() function. Bokeh 可以使用file_html()函数为 Bokeh 文档生成完整的 HTML 页面。 you can refer Embedding Plots and Apps for more detail.您可以参考嵌入图和应用程序以获取更多详细信息。

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")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM