from matplotlib import pyplot as plt import numpy as np import matplotlib.animation as animation import sys class AniPlot(): # init the class def __init__(self): # get the figure object self.fig = plt.figure() # setup a single axes self.ax = plt.subplot(1, 1, 1) # register the callbac to kill the app when the window is closed…