0
$\begingroup$

I have some java code that is taking a set of non-unique integer values and plotting them on a histogram, with the X-scale being the value of the integer and the Y-scale being the frequency with which it occurs in the set.

For simplicity in using the histogram for comparisons at a later stage, the values are grouped into ranges. I would like the be able to control the number of different ranges used to represent all the values in the set(which is also the number of columns in the resultant graph), and currently I am using 40 different ranges.

The maximum value of a possible integer in the set is around 1500, however lower value integers between 0-50 are much more frequent. For this reason, generating the ranges by simply dividing the maximum value by 40 results in a set of ranges where the lowest range, 0-37.5, contains nearly all the values, and creates a very lopsided histogram.

For this reason, I would like the able to generate a non-linear set of ranges roughly like {0 -> 1, 1 -> 2, 2 -> 4, ... , 1375 -> 1500} containing precisely the number of ranges that is required (in the current example being 40 different ranges)

I apologise if I have over-complicated the problem, this was the best way I could think to explain what I need. Thanks very much for any help you can provide.

$\endgroup$
0
$\begingroup$

$t (> 0)$ your target, n number $(> 0)$ of steps and x your multiplier then $x=\sqrt[n]{t}$. This is the geometric progression. If that is the best way to solve your display problem is a different question.

$\endgroup$
  • $\begingroup$ Thank you very much, that's solved my problem. $\endgroup$ – Chris Topher Mar 6 '18 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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