code: def write_frame(self):
          
          if not hasattr(self, 'mwriter'):
              raise AssertionError('This plotter has not opened a movie or GIF file.')
          self.mwriter.append_data(self.image)
docs: Writes a single frame to the movie file