X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=blobdiff_plain;f=src%2Fmath%2Fhistogram.c;fp=src%2Fmath%2Fhistogram.c;h=afc40013e02865f46f82549599f4f9cb84812706;hp=7fc2d08e3de341a49455e0395d7283e204384f79;hb=ac9640a64222cfcf36c401715cad0a2009a07fb6;hpb=5d489646dd5b0c4255c608691a91e639dd8c2ece diff --git a/src/math/histogram.c b/src/math/histogram.c index 7fc2d08e3d..afc40013e0 100644 --- a/src/math/histogram.c +++ b/src/math/histogram.c @@ -222,12 +222,14 @@ histogram_create (double bin_width, double min, double max) assert (bin_width > 0); + bin_width = chart_rounded_tick (bin_width); bins = adjust_bin_ranges (bin_width, min, max, &adjusted_min, &adjusted_max); /* Force the number of bins to lie in a sensible range. */ if (bins > MAX_BINS) { - bins = adjust_bin_ranges ((max - min) / (double) (MAX_BINS - 1), + bin_width = chart_rounded_tick ((max - min) / (double) (MAX_BINS - 1)); + bins = adjust_bin_ranges (bin_width, min, max, &adjusted_min, &adjusted_max); }