<p dir="auto">When trying to use the <a href="http://matplotlib.org/examples/animation/basic_example_writer.html" rel="nofollow"><code class="notranslate">basic_example_writer.py</code> example</a> I have noticed that the first file generated, <code class="notranslate">lines.mp4</code>, is empty. It shows one frame of plot backdrop but none of the lines appear.</p>
<p dir="auto">This also happened with any other animation I myself was trying to write. Thus it seems that <code class="notranslate">FuncAnimation</code> ins incapable of creating animation videos.</p>
<p dir="auto">Tried on platforms: Mac OSX and Ubuntu 14.04</p>
<p dir="auto">I was trying to work out a patch to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="113714022" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/5335" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/5335/hovercard" href="https://github.com/matplotlib/matplotlib/issues/5335">#5335</a> and ran into issues introduced in merge <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="97555714" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/4800" data-hovercard-type="pull_request" data-hovercard-url="/matplotlib/matplotlib/pull/4800/hovercard" href="https://github.com/matplotlib/matplotlib/pull/4800">#4800</a>.  The following code is slightly simplified example from the animations examples:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="%matplotlib nbagg

import matplotlib
import matplotlib.pyplot as plt
import matplotlib.animation as animation

import numpy as np

def update_line(num, data, line):
    line.set_data(data[...,:num])
    return line,

fig = plt.figure()

plt.xlim(0, 1)
plt.ylim(0, 1)

data = np.random.rand(2, 10)
l, = plt.plot([], [], 'r-')

ani = animation.FuncAnimation(fig, update_line, 10, fargs=(data, l),
                                                   interval=50, blit=True)
ani.save('im.gif', writer='imagemagick')"><pre class="notranslate"><code class="notranslate">%matplotlib nbagg

import matplotlib
import matplotlib.pyplot as plt
import matplotlib.animation as animation

import numpy as np

def update_line(num, data, line):
    line.set_data(data[...,:num])
    return line,

fig = plt.figure()

plt.xlim(0, 1)
plt.ylim(0, 1)

data = np.random.rand(2, 10)
l, = plt.plot([], [], 'r-')

ani = animation.FuncAnimation(fig, update_line, 10, fargs=(data, l),
                                                   interval=50, blit=True)
ani.save('im.gif', writer='imagemagick')
</code></pre></div>
<p dir="auto">running this yields:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/12069845/10946139/4b2470c0-82e6-11e5-947f-4a916ce875a4.gif"><img src="https://cloud.githubusercontent.com/assets/12069845/10946139/4b2470c0-82e6-11e5-947f-4a916ce875a4.gif" alt="im 1" data-animated-image="" style="max-width: 100%;"></a></p>
<p dir="auto">The animation displays correctly in the notebook.  The issue is introduced here </p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/matplotlib/matplotlib/blob/5c58ea950e1c2bbe3c615a3a360b5368061ebb2f/lib/matplotlib/animation.py#L766">matplotlib/lib/matplotlib/animation.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 766
      in
      <a data-pjax="true" class="commit-tease-sha" href="/matplotlib/matplotlib/commit/5c58ea950e1c2bbe3c615a3a360b5368061ebb2f">5c58ea9</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L766" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="766"></td>
          <td id="LC766" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">for</span> <span class="pl-s1">anim</span> <span class="pl-c1">in</span> <span class="pl-s1">all_anim</span>: </td>
        </tr>
    </tbody></table>
  </div>
</div>
.  When <code class="notranslate">FuncAnimation._init_draw()</code> is called, if no <code class="notranslate">init_func</code> is given, the first frame sequence is appended to <code class="notranslate">self._save_seq</code>.  After which, <div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/matplotlib/matplotlib/blob/5c58ea950e1c2bbe3c615a3a360b5368061ebb2f/lib/matplotlib/animation.py#L769">matplotlib/lib/matplotlib/animation.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 769
      in
      <a data-pjax="true" class="commit-tease-sha" href="/matplotlib/matplotlib/commit/5c58ea950e1c2bbe3c615a3a360b5368061ebb2f">5c58ea9</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L769" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="769"></td>
          <td id="LC769" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">for</span> <span class="pl-s1">data</span> <span class="pl-c1">in</span> <span class="pl-en">zip</span>(<span class="pl-c1">*</span>[<span class="pl-s1">a</span>.<span class="pl-en">new_saved_frame_seq</span>() </td>
        </tr>
    </tbody></table>
  </div>
</div>
 is executed and <code class="notranslate">FuncAnimation.new_saved_seq()</code> then only returns the first drawn frame for which to iterate over.  The end result is an animation file with only one frame.<p></p>