title: How to animate moving ball
body: <p>I am attempting to do a very simple animation and move a ball from one position to another. I have attempted to create a ball class and method to move the ball given a velocity, position and time.
  However, the output does not update the ball position as predicted but stays in the same position.
  The code can be seen below:</p>
  <pre><code>import pylab as pl
  import numpy as np
  pl.matplotlib.use('Qt5Agg')
  
  class ball:
      def __init__(self,pos,vel,r=1,m=1):
          self._pos = np.array(pos,dtype=&quot;float64&quot;)
          self._vel = np.array(vel,dtype=&quot;float64&quot;)
          self._r = r
          self._mass = m
          self._patch=pl.Circle((self._pos),self._r, fc='red',ec='black') 
  
      def move(self,dt):
          newpos = self._pos + self._vel*dt
          self._pos = newpos
          self._patch = pl.Circle((self._pos),self._r,fc='red',ec='black')
          return self
  
  k=ball([0,0],[7,9])
  f=pl.figure()
  ax = pl.axes(xlim=(-10, 10), ylim=(-10, 10),aspect='1')
  ax.add_patch(k._patch)
  print(k._patch)
  pl.pause(5)
  k.move(1)
  pl.pause(5)
  pl.show()
  </code></pre>
  <p>I have tried figuring out what is wrong but self._patch is updating it's position and if I ax.add_patch the new patch then it appears - however, there are then two balls on the plot. Any help would be very much appreciated.</p>