title: How to update the color bar in an interactive plot
body: <p>The following code plots a 2D array, whose value can be changed interactively. The only thing missing is that I would like it to change the colobar. Somehow, when I modify the image, the colorbar doesn't adjust itself.</p>
  
  <pre><code>from pyplot import *
  from numpy import *
  from matplotlib.widgets import Slider, Button, RadioButtons
  
  ax = subplot(111)
  subplots_adjust(left=0.25, bottom=0.25)
  
  my_img=random((100,100))*10.
  
  l = imshow(my_img,origin='lower');cbar=colorbar()
  
  ax1= axes([0.25, 0.1, 0.65, 0.03], axisbg='w')
  
  par1 = Slider(ax1, 'normalization', 1, 100., valinit=1.5)
  
  def update(val):
    new_normalization = par1.val
    new_img=random((100,100))*new_normalization
  
    l.set_array(new_img)
  
    # this doesn't change the new colobar maximum
    cbar.vmax=new_img.max()
    cbar.vmin=0
    draw()
  
  par1.on_changed(update)
  
  resetax = axes([0.8, 0.025, 0.1, 0.04])
  button = Button(resetax, 'Reset', color='w', hovercolor='0.975')
  def reset(event):
       par1.reset()
  
  button.on_clicked(reset)
  show()
  </code></pre>