Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

matplotlib animate

import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
from celluloid import Camera

numpoints = 10
points = np.random.random((2, numpoints))
colors = cm.rainbow(np.linspace(0, 1, numpoints))
camera = Camera(plt.figure())
for _ in range(100):
    points += 0.1 * (np.random.random((2, numpoints)) - .5)
    plt.scatter(*points, c=colors, s=100)
    camera.snap()
anim = camera.animate(blit=True)
anim.save('scatter.mp4')
Comment

PREVIOUS NEXT
Code Example
Python :: tkinter window size 
Python :: remove new line character from string python 
Python :: python check if list contains 
Python :: (for in) printing in python 
Python :: test_size 
Python :: Get Time from timestamp in python 
Python :: matplotlib python background color 
Python :: Python Requests Library Patch Method 
Python :: how to setup django ionos hostig 
Python :: python string startswith regex 
Python :: python sort the values in a dictionaryi 
Python :: python selenium click element 
Python :: creating numpy array using zeros 
Python :: remove multiindex pandas 
Python :: custom position for axis matplotlib 
Python :: python array usage 
Python :: convert 2d string array to float python 
Python :: Write a Python program to sum all the items in a dictionary. 
Python :: kill and run process in windows python 
Python :: How to Merge train and Test dataset in python 
Python :: jupyter notebook show full dataframe cell 
Python :: python argparse lists flags as optional even with required 
Python :: python absolute path from projectr 
Python :: filter dict 
Python :: check is string is nan python 
Python :: buttons on canvas tkinter 
Python :: turn characters to alpgabetic numper python 
Python :: python split lines 
Python :: pandas normalize columns 
Python :: find max in a dataframe 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =