title: matplotlib contour plot: warning about `no contour levels were found`
body: <p>I was working through an example on a blog <a href="https://brushingupscience.wordpress.com/2016/06/21/matplotlib-animations-the-easy-way/" rel="noreferrer">post</a> about plotting animations with <code>matplotlib.</code> One example involved a contour plot--the code is below. However when I run this code, I get a <code>UserWarning</code></p>
  
  <pre><code> UserWarning: No contour levels were found within the data range.
   warnings.warn("No contour levels were found")
  </code></pre>
  
  <p>The code for the plot is below. </p>
  
  <pre><code>x = np.linspace(-3,3,91)
  t = np.linspace(0,25,30)
  y = np.linspace(-3,3,91)
  X3, Y3, T3 = np.meshgrid(x,y, t)
  
  sinT3 = np.sin(2*np.pi*T3/T3.max(axis=2)[...,np.newaxis])
  G = (X3**2 + Y3**2)*sinT3
  contour_opts = {'levels': np.linspace(-9, 9, 10),
                  'cmap':'RdBu', 'linewidths': 2}
  cax = ax.contour(x, y, G[..., 0], **contour_opts)
  
  def animate(i):
      ax.collections = []
      ax.contour(x, y, G[..., i], **contour_opts)
  anim = FuncAnimation(fig, animate, interval=100, frames = len(t)-1)
  
  HTML(anim.to_html5_video())
  </code></pre>
  
  <p>The plot still works, but I keep getting that user warning. </p>
  
  <p>I checked the matplotlib documentation and found that the <code>levels</code> parameter is still the correct name. So not sure what is causing this error.</p>