Bokeh - Jupyter Notebook

创建于 2024-12-03 / 36
字体: [默认] [大] [更大]

在Jupyter notebook中显示Bokeh图和上面的很像。 您需要做的唯一更改是从 bokeh.plotting 模块导入 output_notebook 而不是 output_file。

from bokeh.plotting import figure, output_notebook, show

调用 output_notebook() 函数将 Jupyter notebook 的输出单元设置为 show() 函数的目标,如下所示 −

output_notebook()
show(p)

在 notebook 单元格中输入代码并运行它。 正弦波将显示在 notebook 内部。



0 人点赞过