def _pt_to_data_coord(ax, x, y):
  """Convert (x, y) value in points into (x', y') value in data coordinates on axes `ax`."""
  t = ax.transData.inverted()
  return t.transform((x, y)) - t.transform((0, 0))