Inkrementelle Animation mit matplotlib
Da wäre wohl kaum einer drauf gekommen: diese Animation wurde mit matplotlib produziert! Allerdings nicht das animierte GIF, nur die Bilder dafür.
     Das Python-Script
Das Script enthält eigentlich nur drei spezielle Anweisungen: plt.draw, plt.savefig und plt.pause. Die Namen sind mehr oder weniger selbsterklärend.
Die Achsen sind unterdrückt, denn bei dieser Darstellung würden sie nur stören.
# Import the libraries
import matplotlib.pyplot as plt
import math
# Class for 2D points
class Point:
    def __init__( self, x, y ):
        self.x = x
        self.y = y
# Computes a list of 400 points on the cirumference of a circle
def init():
    rot = 2.199114858
    points = []
    delta = math.pi / 100
    for i in range(200):
        points.append( Point(math.sin(i*delta+rot)*350,math.cos(i*delta+rot)*350) )
    return points
# Initialize the list of points
points = init()
# Defines the canvas
plt.figure( figsize=(5,5) )
plt.axis( [-400,400,-400,400] )
plt.axis( "off" )
# Draws the figure (incrementally)
f = 60
for i in range(1,60):
    # Draws a line from points[i] to points[2*i]
    plt.plot( [points[i].x,points[f*i % 200].x], [points[i].y,points[i*f % 200].y] )
    # Updates the view
    plt.draw()
    # Saves the image
    plt.savefig( f"fig{i:04d}", bbox_inches="tight" )
    plt.pause(0.1)
# Display the finished plot
plt.show()
     Das animierte GIF
savefig schreibt jeden einzelnen Schritt in ein .PNG, schön sauber numeriert damit die Shell sie richtig sortiert.
Diese Bilder wurden dann mit convert (eine Linux-Utility) zu einem animierten Bild zusammengefügt. Leider habe ich die Kommandozeile nicht dokumentiert :-/
Download
Wenn Sie das Script herunterladen können Sie auch selber damit spielen.
Ein Jahr später...
Ein Jahr später habe ich herausgefunden dass man animierte GIFs auch direkt mit matplotlib erzeugen kann. Dieser Post beschreibt die einfachere Version.