Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6939841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:40:29+00:00 2026-05-27T12:40:29+00:00

So, I learned how to make cute little animations in matplotlib. For example, this:

  • 0

So, I learned how to make cute little animations in matplotlib. For example, this:

import numpy as np
import matplotlib
import matplotlib.pyplot as plt

plt.ion()

fig = plt.figure() 
ax  = fig.add_subplot(111) 

ax.set_xlim(0, 1)
ax.set_ylim(-2,2)

dt = 0.01
q  = 0.01
t = np.arange(0,1,dt)
x = np.sin(2*np.pi*t)
line, = ax.plot(t,x, '-')
fig.canvas.draw()
for i in xrange(100):
    x = (1-q) * x + q* np.random.normal(size = len(t))
    line.set_ydata(x)
    fig.canvas.draw()

This works and it’s very nice. But how I use this to make a movie I can display, for example, in a pdf presentation? I tried to do fig.savefig("test.gif") but there’s an error message indicating that matplotlib doesn’t export gifs.

Is there a way of doing this without resorting to external tools (like making a lot of png’s and stitching them together)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:40:30+00:00Added an answer on May 27, 2026 at 12:40 pm

    In short, no there is no other way besides using an external tool. There is a new module in 1.1.0 that helps you do animations and save them to mpeg4 format. It uses an external tool to automatically do this conversion, from many frames to a single movie. You can make your gif using imagemagick‘s convert or use ffmpeg or mencoder, which are the two options provided by the new animation module.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently make a Server, I learned to make something like this: while(true)
I'm reading The C Programming Language and learned how to make a reverse Polish
I learned how to create a view controller and make the view slide in
I've recently started learning C#. I just learned about properties and decided to make
Apologies if this doesn't make any sense, I'm very new to Python! From testing
I just learned that I could use chmod make myscript.sh executable and the run
I just learned that, quoting make a huge difference in some cases, and I
I just learned that defining a c++ function inside a class's header file make
I want to make a site, and I've learned a few languages, but I
I learned that I should unlock reverse order to lock order. For example. A.lock();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.