code: def get_limits(self, coord='data'):
          
          limits = self.t_['limits']
  
          if limits is None:
              # No user defined limits.  If there is an image loaded
              # use its dimensions as the limits
              image = self.get_image()
              if image is not None:
                  wd, ht = image.get_size()
                  limits = ((self.data_off, self.data_off),
                            (float(wd - 1 + self.data_off),
                             float(ht - 1 + self.data_off)))
  
              else:
                  # Calculate limits based on plotted points, if any
                  canvas = self.get_canvas()
                  pts = canvas.get_points()
                  if len(pts) > 0:
                      limits = trcalc.get_bounds(pts)
                  else:
                      # No limits found, go to default
                      limits = ((0.0, 0.0), (0.0, 0.0))
  
          # convert to desired coordinates
          crdmap = self.get_coordmap(coord)
          limits = crdmap.data_to(limits)
  
          return limits
docs: Get the bounding box of the viewer extents.
  
          Returns
          -------
          limits : tuple
              Bounding box in coordinates of type `coord` in the form of
                 ``(ll_pt, ur_pt)``.