I am beginner in working with machine learning. I would like to ask a question that How could I set the same number of datapoints in the different ranges in correlation chart? Or any techniques for doing that? enter image description here. Specifically, I want to set the same number of datapoints in each range (0-10; 10-20;20-30;...) in the image above. Thanks for any help.

  • $\begingroup$ What is the reason for wanting to do that? $\endgroup$ May 12, 2022 at 14:11
  • $\begingroup$ In my actual case, after getting the correlation chart, it somehow got the saturation and overestimation. I asked for my supervisor and he just said to me for doing that. I have no ideas how to do. If you have any suggestion or guide me to do that, I strongly appreciate. $\endgroup$ May 12, 2022 at 14:19
  • $\begingroup$ there are ways to make the data less dense depending on the language. you can also do this manually by binning the output data. e.g taking the midpoint of each of the ranges e.g 0-5=2.5. That would reduce the density but not sure how to exactly same number in each bin. that would take a little programming. $\endgroup$ May 12, 2022 at 14:38
  • $\begingroup$ Have you tried something like that before? Or just an example in Python, JavaScript or R. $\endgroup$ May 12, 2022 at 14:43
  • $\begingroup$ I've edited my real chart case. $\endgroup$ May 12, 2022 at 14:47

1 Answer 1


You can bin your variables to prevent overplotting and make the output cleaner.

Here is an example from StackOverflow:


This may not be exactly what you need since you did say you want the same number of datapoints in each range (or bin). You would have to add some code if you wanted that exact format.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.