title: Unable to make FuncAnimation work in a Class
body: <p>I am having trouble with making FuncAnimation work in this code given below </p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from matplotlib.animation import FuncAnimation
  %matplotlib notebook
  
  
  class Simulator:
      def __init__(self, timesteps = 1000, ):
          self.simulation_time = np.linspace(0, timesteps, 10*(timesteps)+1)
          self._theta = np.arange(0,100, 10*(timesteps)+1)
  
      def init_plot(self):
          self._p1, = self.axes.plot(self.simulation_time[0], self._theta[0])
          return self.fig,
  
      def update_plot(self, i):
          self._p1.set_data(self.simulation_time[:i], self._theta[:i])
          return self.fig,
  
      def start_simulation(self):
  
          self.fig, self.axes = plt.subplots()
          ani=FuncAnimation(fig=self.fig, func=self.update_plot, init_func=self.init_plot,
                            interval=5, blit=True)
          plt.show()
  
  
  simHandler = Simulator()
  simHandler.start_simulation()
  </code></pre>
  
  <p>All i see after running this code is a blank screen..
  <a href="https://i.stack.imgur.com/2jyuy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2jyuy.png" alt="enter image description here"></a>
  But when i run similar code outside the Class as simple functions, the animation runs, any idea as to how to fix this?</p>