projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix issue reported on macos where the toolbar icons were not displayed.
[pspp]
/
src
/
output
/
charts
/
plot-hist-cairo.c
diff --git
a/src/output/charts/plot-hist-cairo.c
b/src/output/charts/plot-hist-cairo.c
index ca1a30807a5bf195f0b358b9032a32f950c74e08..93133c2e9e0acb46d93dab01a15f40fc8b234080 100644
(file)
--- 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.
/* 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
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 "output/charts/plot-hist.h"
+#include <float.h>
#include <gsl/gsl_randist.h>
#include "data/val-type.h"
#include <gsl/gsl_randist.h>
#include "data/val-type.h"
@@
-86,9
+87,7
@@
hist_draw_bar (cairo_t *cr, const struct xrchart_geometry *geom,
assert ( upper >= lower);
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,
cairo_rectangle (cr,
geom->axis[SCALE_ABSCISSA].data_min + x_pos,
@@
-104,8
+103,9
@@
hist_draw_bar (cairo_t *cr, const struct xrchart_geometry *geom,
cairo_stroke (cr);
if (label)
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
}
void