title: Change content of image interactively using slider widgets
body: <p>I am trying to change content of an image interactively using a slider (e.g. for applying a median operation with different kernel sizes). </p>
  
  <p>While this works well if I only show one resulting image (cf commented lines), I run into trouble when using the subplot function, since the image will not get updated.</p>
  
  <p>What am I missing?</p>
  
  <pre><code>%matplotlib inline
  from ipywidgets import interact, widgets
  import matplotlib.pyplot as plt
  import warnings
  
  from skimage.morphology import disk
  from skimage.filters import rank
  from skimage.color import rgb2gray
  import skimage.data
  
  
  def f(Median_Size):
      selem = disk(int(Median_Size))
      with warnings.catch_warnings():
          warnings.simplefilter("ignore")
          img_median = rank.median(img_gray, selem=selem) 
  
      ax_neu.imshow(img_median, cmap="gray")
      fig.canvas.draw()
      #plt.imshow(img_median, cmap="gray") #This would work
      #plt.show()
  
  image = skimage.data.camera() #plt.imread("Test.png")       
  img_gray = rgb2gray(image)
  
  fig = plt.figure(figsize=(6, 4))
  ax_orig = fig.add_subplot(121) 
  ax_neu = fig.add_subplot(122) 
  
  ax_orig.imshow(img_gray, cmap="gray")
  ax_neu.imshow(img_gray, cmap="gray")
  
  interact(f, Median_Size=widgets.IntSlider(min=1,max=21,step=2,value=1)) 
  </code></pre>