X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcharts%2Fplot-hist-cairo.c;h=93133c2e9e0acb46d93dab01a15f40fc8b234080;hb=e19fd7f7bb229404630b50b4c2fe4b1244d54eb0;hp=87409b1a90937bd76a62c668e033df74bbc80aea;hpb=6b3938165488f5562ab4c1e4a808f2f36407956c;p=pspp diff --git a/src/output/charts/plot-hist-cairo.c b/src/output/charts/plot-hist-cairo.c index 87409b1a90..93133c2e9e 100644 --- a/src/output/charts/plot-hist-cairo.c +++ b/src/output/charts/plot-hist-cairo.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009, 2011 Free Software Foundation, Inc. + Copyright (C) 2009, 2011, 2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,6 +18,7 @@ #include "output/charts/plot-hist.h" +#include #include #include "data/val-type.h" @@ -102,8 +103,9 @@ hist_draw_bar (cairo_t *cr, const struct xrchart_geometry *geom, cairo_stroke (cr); if (label) - draw_tick (cr, geom, SCALE_ABSCISSA, - x_pos + width / 2.0, "%g", (upper + lower) / 2.0); + draw_tick (cr, geom, SCALE_ABSCISSA, bins > 10, + x_pos + width / 2.0, "%.*g", + DBL_DIG + 1, (upper + lower) / 2.0); } void