What to do when PDFs are not Gaussian/Normal in Naive Bayes Classifier
The relationship between the axes of graph (1) and your variables $x$ and $y$ is not clear, so this generalized answer may be helpful or useless.

From graph (1) it appears that the correlation coefficient $\mathcal{C}$ of a quadratic fit of data set $\mathcal{S}$ would be much better.  Consider $y_1$ and $y_2$ approximations of $y$.

$$
\mathcal{C} (y_2, a, b, c, \mathcal{S}) &gt; \mathcal{C} (y_1, a, b, \mathcal{S}) \\
y_2 = ax^2 + bx + c \\
y_1 = ax + b
$$

To achieve a more nearly uniform distribution, perform a least squares fit for $y_2$ against $y$ on $\mathcal{S}$ to obtain $(a, b, c)$.  Then find a mapping function that produces $y'$ and use it where the uniform distribution is desired.  A reasonable approximation is simply this.

$$y' = \frac{y}{y_2(x)}$$