Skip to content
Snippets Groups Projects
Commit 1e4d18c8 authored by Tim Molter's avatar Tim Molter
Browse files

histogram tweaks

parent 51ae7949
No related branches found
No related tags found
No related merge requests found
...@@ -70,11 +70,8 @@ public class Histogram { ...@@ -70,11 +70,8 @@ public class Histogram {
this.numBins = numBins; this.numBins = numBins;
this.originalData = data; this.originalData = data;
// Arrays.sort(data);
this.min = min; this.min = min;
this.max = max; this.max = max;
// this.min = data[0];
// this.max = data[data.length - 1];
init(); init();
} }
...@@ -90,8 +87,13 @@ public class Histogram { ...@@ -90,8 +87,13 @@ public class Histogram {
int bin = (int) ((((Number) itr.next()).doubleValue() - min) / binSize); // changed this from numBins int bin = (int) ((((Number) itr.next()).doubleValue() - min) / binSize); // changed this from numBins
if (bin < 0) { /* this data is smaller than min */ if (bin < 0) { /* this data is smaller than min */
System.out.println("less than");
} }
else if (bin >= numBins) { /* this data point is bigger than max */ else if (bin > numBins) { /* this data point is bigger than max */
System.out.println("greater than");
}
else if (bin == numBins) { // this falls right on the edge of the max bin
tempYAxisData[bin - 1] += 1;
} }
else { else {
tempYAxisData[bin] += 1; tempYAxisData[bin] += 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment