title: Matplotlib Animate a box plot
body: <p>I'm trying to animate a box plot as data shifts over a time series.</p>
  
  <p>I'm working off the matplotlib animate examples, which show how it works with the plot function, but that doesn't seem to carry over for a boxplot function:</p>
  
  <p><strong>Code Works below, but changing the two lines to box plot gives me errors</strong></p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib.animation as animation
  
  fig, ax = plt.subplots()
  line, = ax.plot(np.arange(10))  # &lt;-- ax.boxplot(np.arange(10))
  ax.set_ylim(0, 20)
  
  
  def update(data):
      line.set_ydata(data)  # &lt; -- line = ax.boxplot(data)? 
      return line,
  
  
  def data_gen():
      i = 0
      while True:
          yield np.arange(10) + i
          i += .1
  
  ani = animation.FuncAnimation(fig, update, data_gen, interval=100)
  plt.show()
  </code></pre>
  
  <p>Boxplot also doesn't seem to have a "set_data" function, or an "animated=True" parameter.</p>
  
  <p>Essentially I'd like the animation to work the same as above, but depicting a box plot instead of a line plot.</p>