If it doesn't HAVE to be a scatter plot, the general consensus is to just use bubble. basically, the exact same code but use bubble instead of scatter plot
sysuse auto2, clear gen weight2 = sqrt(weight) twoway bubble price mpg, size(weight2)