title: updating bokeh plot with a bokeh widget in jupyter notebook
body: <p>I want to use bokeh widgets from within a jupyter notebook to update a bokeh plot. My (somewhat hacky) code looks like this:</p>
  
  <pre><code>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_handle)  
  
  
  bokeh_handle = show(fig, notebook_handle=True)
  
  ##### new notebook cell #####
  
  callback = CustomJS(code="""
  if (IPython.notebook.kernel !== undefined) {
      var kernel = IPython.notebook.kernel;
      cmd = "update_plot(" + cb_obj.value + ")";
      kernel.execute(cmd, {}, {});
  }
  """)
  
  slider = Slider(start=0.1, 
                  end=1,
                  value=1,
                  step=.05,
                  title="power",
                  callback=callback)
  show(slider)
  </code></pre>
  
  <p>The idea is that the JS callback for the slider calls the python function <code>update_plot()</code>, which changes the data of the bokeh plot and then triggers a <code>push_notebook()</code>.</p>
  
  <p>However, when I move the slider, the plot is not updated, but <a href="https://i.stack.imgur.com/AiZlm.png" rel="nofollow noreferrer">some weird glyphs appear in the upper left corner (see red arrow)</a>.</p>
  
  <p>Executing <code>print(plt.data_source.data['y'])</code> showed me that the callback and <code>update_plot()</code> were actually called upon slider movement. Why is the plot not properly updated? Or am I missing something here?</p>
  
  <p>(I know that I can do the same thing using <code>ipywidgets.interact</code>, but I want to stick to bokeh widgets.)</p>