0
我想要在Jupyter筆記本中內聯三個散景散點圖。我以前可以做到這一點,但在更新Bokeh後,我無法使其工作。現在有什麼需要改變的嗎?使用for循環在Jupyter中生成內聯散焦散點圖
from bokeh.plotting import figure, output_file, output_notebook, show
output_notebook()
x = dfList[0][1]['ValueA']
for i in range(0,3):
#Define figure
p = figure(plot_width=900, plot_height=600,
tools="pan,wheel_zoom,lasso_select,box_zoom,reset,save,undo")
#Add four datasets to figure
for t in range(4):
y = dfList[t][1]['ValueB']
plot_data = p.circle(x,y)
#Display figure in notebook
show(p)
隨着上面的代碼,只顯示第一個圖。我曾嘗試
from bokeh.plotting import reset_output
,並添加show(p)
在每次迭代,這確實產生了三個地塊後reset_output()
,但他們是在一個單獨的瀏覽器選項卡每個輸出,這不是我想要的。
如果我還在每個迭代中添加output_notebook()
,而不是僅在筆記本的第一個單元格中,那麼我仍然只會得到第一個繪圖,其他兩個迭代將顯示「Loading BokehJS ...」消息。
我在做什麼錯?
非常感謝你的幫助。指定佈局更有意義。 – Violet