Reputation: 1497
I have a set of values (temperature readings) that are like this : 0,1,3,3.3,3.44,10,11,11,11.1,11.4,11.4,11.5,12.1,13.1,14,15,19,50,67,70,81.
What I need is a type of horizontal line graph that looks like in the attached image but it can automatically split those values into 3 intelligent intervals ( for our example we see the most numbers are between 10 and 15 so that would be the main interval, and the other 2 will be for numbers smaller than 10 and for numbers bigger than 15).
So the plotted data would be something like : 10% for between 1-10 70% for between 10-15 20% for 15+
Anyone have any ideas?!
Thank you
click to see an example of the needed graph type
Upvotes: 0
Views: 88
Reputation: 770
What you describe is basically a 1-dimension clustering problem (here's a similar question on stats.SE).
There are many algorithms to do this, for example k-means or Expectation-Maximisation. I'd suggest the former if you're looking for something simple.
Once you have your clustering, all you have left to do is to plug the data into whatever chart API you want to use.
Upvotes: 1