From: John Darrington Date: Tue, 20 Mar 2012 18:49:05 +0000 (+0100) Subject: Correct geometrical error plotting histograms X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f6d3595c0efb2bf7e9670435d18f2ebb086fdd1;p=pspp Correct geometrical error plotting histograms --- diff --git a/src/output/charts/plot-hist-cairo.c b/src/output/charts/plot-hist-cairo.c index d000a1ac21..7c09b6df73 100644 --- a/src/output/charts/plot-hist-cairo.c +++ b/src/output/charts/plot-hist-cairo.c @@ -81,8 +81,9 @@ hist_draw_bar (cairo_t *cr, const struct xrchart_geometry *geom, assert ( upper >= lower); - height = gsl_histogram_get (h, bar) * - (geom->data_top - geom->data_bottom) / gsl_histogram_max_val (h); + height = gsl_histogram_get (h, bar) / + (geom->y_max - geom->y_min) * + (geom->data_top - geom->data_bottom); cairo_rectangle (cr, geom->data_left + x_pos, geom->data_bottom, width, height);