code: def repel_text_from_points(x, y, texts, renderer=None, ax=None,
                             expand=(1.2, 1.2), move=False):
      
      assert len(x) == len(y)
      if ax is None:
          ax = plt.gca()
      if renderer is None:
          r = get_renderer(ax.get_figure())
      else:
          r = renderer
      bboxes = get_bboxes(texts, r, expand, ax=ax)
  
      # move_x[i,j] is the x displacement of the i'th text caused by the j'th point
      move_x = np.zeros((len(bboxes), len(x)))
      move_y = np.zeros((len(bboxes), len(x)))
      for i, bbox in enumerate(bboxes):
          xy_in = get_points_inside_bbox(x, y, bbox)
          for j in xy_in:
              xp, yp = x[j], y[j]
              dx, dy = overlap_bbox_and_point(bbox, xp, yp)
  
              move_x[i, j] = dx
              move_y[i, j] = dy
  
      delta_x = move_x.sum(axis=1)
      delta_y = move_y.sum(axis=1)
      q = np.sum(np.abs(move_x)), np.sum(np.abs(move_y))
      if move:
          move_texts(texts, delta_x, delta_y, bboxes, ax=ax)
      return delta_x, delta_y, q
docs: Repel texts from all points specified by x and y while expanding their
      (texts'!) bounding boxes by expandby  (x, y), e.g. (1.2, 1.2)
      would multiply both width and height by 1.2.
      Requires a renderer to get the actual sizes of the text, and to that end
      either one needs to be directly provided, or the axes have to be specified,
      and the renderer is then got from the axes object.