X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcharts%2Fplot-hist-cairo.c;h=a9a5d44f58b475aef164f8fe9077008d4264ece8;hb=b51ab36f5a828654ed03e96c90a1241852f6d70c;hp=ca1a30807a5bf195f0b358b9032a32f950c74e08;hpb=06828219465e82377f18da84af39a2575339df00;p=pspp diff --git a/src/output/charts/plot-hist-cairo.c b/src/output/charts/plot-hist-cairo.c index ca1a30807a..a9a5d44f58 100644 --- a/src/output/charts/plot-hist-cairo.c +++ b/src/output/charts/plot-hist-cairo.c @@ -86,9 +86,7 @@ hist_draw_bar (cairo_t *cr, const struct xrchart_geometry *geom, assert ( upper >= lower); - height = gsl_histogram_get (h, bar) / - (geom->axis[SCALE_ORDINATE].max - geom->axis[SCALE_ORDINATE].min) * - (geom->axis[SCALE_ORDINATE].data_max - geom->axis[SCALE_ORDINATE].data_min); + height = geom->axis[SCALE_ORDINATE].scale * gsl_histogram_get (h, bar); cairo_rectangle (cr, geom->axis[SCALE_ABSCISSA].data_min + x_pos, @@ -104,7 +102,7 @@ hist_draw_bar (cairo_t *cr, const struct xrchart_geometry *geom, cairo_stroke (cr); if (label) - draw_tick (cr, geom, SCALE_ABSCISSA, + draw_tick (cr, geom, SCALE_ABSCISSA, bins > 10, x_pos + width / 2.0, "%g", (upper + lower) / 2.0); }