updating bokeh plot with a bokeh widget in jupyter notebook
问题 I want to use bokeh widgets from within a jupyter notebook to update a bokeh plot. My (somewhat hacky) code looks like this: from bokeh.plotting import figure from bokeh.io import output_notebook, push_notebook, show from bokeh.models import CustomJS, Slider output_notebook() power = 0.5 x = [1,2,3] y = [i**power for i in x] fig = figure() plt = fig.circle(x, y) def update_plot(power): x = plt.data_source.data['x'] plt.data_source.data['y'] = [i**power for i in x] push_notebook(handle=bokeh