title: How do I get rid of attribute error in matplotlib animation
body: <p>I want to turn a series of matplotlib figures into an animation. However, whatever I do, I always receive error. I use Enthought Canopy 1.6.2 and Python 2.7.13 on Windows 10. </p>
  
  <p>I have tried using <a href="https://github.com/bilylee/videofig/blob/master/videofig.py" rel="nofollow noreferrer">videofig</a> package. While it was good, I could not manage to save the mp4 file. Also, I believe using the source directly, i.e., matplotlib animation package would be more versatile for future uses. I checked a few answers, including <a href="https://stackoverflow.com/questions/17853680/animation-using-matplotlib-with-subplots-and-artistanimation">1</a>, <a href="https://stackoverflow.com/questions/17212722/matplotlib-imshow-how-to-animate">2</a> and <a href="https://stackoverflow.com/questions/51689665/how-am-i-able-to-import-matplotlib-without-an-error">3</a>, yet none of them solved my problem.</p>
  
  <p>The function I call is structured as follows.</p>
  
  <pre class="lang-py prettyprint-override"><code>def some_plotter(self, path, start_value, image_array)
      some_unrelated_fig_functions()
      im=plt.savefig(path, animated=True)
      image_array.append([im])
      plt.close("all")
  </code></pre>
  
  <p>The main code is as follows:</p>
  
  <pre class="lang-py prettyprint-override"><code>import matplotlib.animation as animation
  image_array=[]
  while(something):
      some_obj.some_plotter(path, start_value, image_array)
  fig = plt.figure()
  ani = animation.ArtistAnimation(fig, image_array, interval=50, blit=True, repeat_delay=1000)
  </code></pre>
  
  <p>I receive the following error: </p>
  
  <blockquote>
    <p>Traceback (most recent call last):
      File "C:\Users\kocac\AppData\Local\Enthought\Canopy\edm\envs\User\lib\site-packages\matplotlib\cbook__init__.py", line 387, in process
        proxy(*args, **kwargs)
      File "C:\Users\kocac\AppData\Local\Enthought\Canopy\edm\envs\User\lib\site-packages\matplotlib\cbook__init__.py", line 227, in <strong>call</strong>
        return mtd(*args, **kwargs)
      File "C:\Users\kocac\AppData\Local\Enthought\Canopy\edm\envs\User\lib\site-packages\matplotlib\animation.py", line 1026, in _start
        self._init_draw()
      File "C:\Users\kocac\AppData\Local\Enthought\Canopy\edm\envs\User\lib\site-packages\matplotlib\animation.py", line 1557, in _init_draw
        artist.set_visible(False)
    AttributeError: 'NoneType' object has no attribute 'set_visible'</p>
  </blockquote>
  
  <p>I had more similar lines to this, yet updating Matplotlib, following the suggestion at <a href="https://stackoverflow.com/questions/51689665/how-am-i-able-to-import-matplotlib-without-an-error">3</a> reduced the error lines to 4. Yet I cannot proceed any longer. Note that saved images are perfectly fine so I am probably not doing anything wrong in the image creation.</p>
  
  <p>How can I get rid of these errors? Where am I going wrong?</p>