Xt = ax.transData.transform(X)
st = np.sqrt(s)
pairs = product(Xt, Xt)
sizes = product(st, st)
for i, ((x, y), (sx, sy)) in enumerate(zip(pairs, sizes)):
    h = i % 3
j = i // 3
if h != j and overlap(x, y, sx, sy):
    pass
How can I convert from scatter size to data coordinates in matplotlib?