def METHOD_NAME(self, log, resample=True, **kwargs):
    """
    Args:
        log: A reference to a pydrake.systems.primitives.VectorLog, or a
            pydrake.trajectories.Trajectory that contains the plant state
            after running a simulation.
        resample: Whether we should do a resampling operation to make the
            samples more consistent in time. This can be disabled if you
            know the draw_period passed into the constructor exactly
            matches the sample time step of the log.
        Additional kwargs are passed through to FuncAnimation.
    """
    if isinstance(log, VectorLog):
        t = log.sample_times()
        x = log.data()
        if resample:
            t, x = _resample_interp1d(t, x, self.time_step)
    elif isinstance(log, Trajectory):
        t = np.arange(log.start_time(), log.end_time(), self.time_step)
        x = np.hstack([log.value(time) for time in t])
    def animate_update(i):
        self.draw(x[:, i])
    # We defer this import to this call site to prevent the import
    # from hanging. See #18323.
    import matplotlib.animation as animation
    ani = animation.FuncAnimation(fig=self.fig,
                                  func=animate_update,
                                  frames=t.shape[0],
                                  # Convert from s to ms.
                                  interval=1000*self.time_step,
                                  **kwargs)
    return ani