From 1f6d3595c0efb2bf7e9670435d18f2ebb086fdd1 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 20 Mar 2012 19:49:05 +0100 Subject: [PATCH] Correct geometrical error plotting histograms --- src/output/charts/plot-hist-cairo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.30.2