1

Im trying to make a gif out of the following plot:

import matplotlib.pyplot as plt
import random

for i in range(100):
    plt.scatter(random.normalvariate(100,10), random.normalvariate(100,10), marker='o', s=3, c= "black");

i tryed to do it with the gif library like follows:

import matplotlib.pyplot as plt
import random
import gif

@gif.frame
def plot():
    plt.scatter(random.normalvariate(100,10), random.normalvariate(100,10), marker='o', s=3, c= "black");
frames = []
for i in range(100):
    frame = plot()
    frames.append(frame)
gif.save(frames, 'example.gif', duration=3.5, unit="s", between="startend")

So it does make the gif but every plot deletes the previus one and i want it to plot on top of the previus plot. So the result is adding points over points. Thanks for the help.

shinwc
  • 11
  • 1

0 Answers0