Bokeh - Jupyter Notebook



在 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 中。

廣告
© . All rights reserved.