-/* This functions adjusts the upper and lower range of the histogram to make them fit BIN_WIDTH
- MIN and MAX are the lowest and highest data to be plotted in the histogram.
- ADJ_MIN and ADJ_MAX are locations of the adjusted values of MIN and MAX (the range will always be
- equal or slightly larger).
- Returns the number of bins.
- */
-static int
-adjust_bin_ranges (double bin_width, double min, double max, double *adj_min, double *adj_max)
-{
- const double half_bin_width = bin_width / 2.0;
-
- /* The lower and upper limits of the histogram, in units of half
- bin widths */
- int lower_limit, upper_limit;
-
- /* -1 if the lower end of the range contains more unused space
- than the upper end.
- +1 otherwise. */
- short sparse_end = 0;
-
- double ul, ll;
- double lower_remainder = fabs (modf (min / half_bin_width, &ll));
- double upper_remainder = fabs (modf (max / half_bin_width, &ul));
-
-
- assert (max > min);
+/* Find a bin width which is adapted to the scaling of the x axis
+In the example here, the binwidth is half of the tick interval.