/* PSPP - a program for statistical analysis.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2009 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
pl_restorestate_r(ch->lp);
- {
- char buf[5];
- snprintf(buf,5,"%g",(upper + lower) / 2.0);
- draw_tick(ch, TICK_ABSCISSA,
- x_pos + width / 2.0, buf);
- }
+ draw_tick (ch, TICK_ABSCISSA,
+ x_pos + width / 2.0, "%g", (upper + lower) / 2.0);
}
}
struct chart *ch;
ch = chart_create();
+ if (ch == NULL)
+ return;
+
chart_write_title(ch, _("HISTOGRAM"));
chart_write_ylabel(ch, _("Frequency"));
gsl_histogram_get_range(hist, 0, &x_min, ¬_used);
range = not_used - x_min;
gsl_histogram_get_range(hist, bins - 1, ¬_used, &x_max);
- assert(range == x_max - not_used);
abscissa_scale = (ch->data_right - ch->data_left) / (x_max - x_min);
ordinate_scale = (ch->data_top - ch->data_bottom) /