code: def redraw(self, whence=0):
          
          with self._defer_lock:
              whence = min(self._defer_whence, whence)
  
              if not self.defer_redraw:
                  if self._hold_redraw_cnt == 0:
                      self._defer_whence = self._defer_whence_reset
                      self.redraw_now(whence=whence)
                  else:
                      self._defer_whence = whence
                  return
  
              elapsed = time.time() - self.time_last_redraw
  
              # If there is no redraw scheduled, or we are overdue for one:
              if (not self._defer_flag) or (elapsed > self.defer_lagtime):
                  # If more time than defer_lagtime has passed since the
                  # last redraw then just do the redraw immediately
                  if elapsed > self.defer_lagtime:
                      if self._hold_redraw_cnt > 0:
                          #self._defer_flag = True
                          self._defer_whence = whence
                          return
  
                      self._defer_whence = self._defer_whence_reset
                      self.logger.debug("lagtime expired--forced redraw")
                      self.redraw_now(whence=whence)
                      return
  
                  # Indicate that a redraw is necessary and record whence
                  self._defer_flag = True
                  self._defer_whence = whence
  
                  # schedule a redraw by the end of the defer_lagtime
                  secs = self.defer_lagtime - elapsed
                  self.logger.debug("defer redraw (whence=%.2f) in %.f sec" % (
                      whence, secs))
                  self.reschedule_redraw(secs)
  
              else:
                  # A redraw is already scheduled.  Just record whence.
                  self._defer_whence = whence
                  self.logger.debug("update whence=%.2f" % (whence))
docs: Redraw the canvas.
  
          Parameters
          ----------
          whence
              See :meth:`get_rgb_object`.