msgid ""
msgstr ""
"Project-Id-Version: PSPP 0.3.1\n"
-"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
"POT-Creation-Date: 2005-05-07 16:45+0800\n"
"PO-Revision-Date: 2004-01-23 13:04+0800\n"
"Last-Translator: John Darrington <john@darrington.wattle.id.au>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
+"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
#: src/aggregate.c:195
+Sun May 8 08:08:07 WST 2005 John Darrington <john@darrington.wattle.id.au>
+
+ * barchart.c box-whisker.c cartesian.c piechart.c plot-hist.c: Fixed
+ more ISO/IEC 9899:1990 conformance issues.
+
Wed May 4 23:54:02 2005 Ben Pfaff <blp@gnu.org>
Fix PR 12948. See also new test in
draw_barchart(struct chart *ch, const char *title,
const char *xlabel, const char *ylabel, enum bar_opts opt)
{
-
double d;
int i;
double bar_width = interval_size / 1.1 ;
+ double ordinate_scale = fabs(ch->data_top - ch->data_bottom) /
+ fabs(y_max - y_min) ;
+
if ( opt != BAR_STACKED )
bar_width /= SUB_CATAGORIES;
- double ordinate_scale = fabs(ch->data_top - ch->data_bottom) / fabs(y_max - y_min) ;
-
/* Move to data bottom-left */
pl_move_r(ch->lp, ch->data_left, ch->data_bottom);
double whisker[2];
int i;
- assert(m);
-
-
const double *hinge = m->hinge;
struct weighted_value **wvp = m->wvp;
const int n_data = m->n_data;
const double box_top =
ch->data_bottom + ( hinge[2] - ch->y_min ) * ch->ordinate_scale;
+ assert(m);
+
/* Can't really draw a boxplot if there's no data */
if ( n_data == 0 )
return ;
}
-
+ {
const double bottom_whisker =
ch->data_bottom + ( whisker[0] - ch->y_min ) * ch->ordinate_scale;
pl_fline_r(ch->lp,
box_centre, top_whisker,
box_centre, box_top);
+ }
/* Draw outliers */
for ( i = 0 ; i < n_data ; ++i )
void
chart_datum(struct chart *ch, int dataset UNUSED, double x, double y)
{
-
if ( ! ch )
return ;
+ {
+ const double x_pos =
+ (x - ch->x_min) * ch->abscissa_scale + ch->data_left ;
+ const double y_pos =
+ (y - ch->y_min) * ch->ordinate_scale + ch->data_bottom ;
- const double x_pos =
- (x - ch->x_min) * ch->abscissa_scale + ch->data_left ;
-
- const double y_pos =
- (y - ch->y_min) * ch->ordinate_scale + ch->data_bottom ;
-
- pl_savestate_r(ch->lp);
+ pl_savestate_r(ch->lp);
- pl_fmarker_r(ch->lp, x_pos, y_pos, 6, 15);
-
- pl_restorestate_r(ch->lp);
+ pl_fmarker_r(ch->lp, x_pos, y_pos, 6, 15);
+ pl_restorestate_r(ch->lp);
+ }
}
/* Draw a line with slope SLOPE and intercept INTERCEPT.
int i;
double total_magnetude=0;
- struct chart *ch;
-
- ch = chart_create();
+ struct chart *ch = chart_create();
const double left_label = ch->data_left +
(ch->data_right - ch->data_left)/10.0;
static void
hist_draw_bar(struct chart *ch, const gsl_histogram *hist, int bar)
{
- double upper;
- double lower;
- double height;
-
if ( !ch )
- return ;
- const size_t bins = gsl_histogram_bins(hist);
- const double x_pos = (ch->data_right - ch->data_left) * bar / (double) bins ;
- const double width = (ch->data_right - ch->data_left) / (double) bins ;
+ return ;
- assert ( 0 == gsl_histogram_get_range(hist, bar, &lower, &upper));
+ {
+ double upper;
+ double lower;
+ double height;
- assert( upper >= lower);
+ const size_t bins = gsl_histogram_bins(hist);
+ const double x_pos = (ch->data_right - ch->data_left) * bar / (double) bins ;
+ const double width = (ch->data_right - ch->data_left) / (double) bins ;
- height = gsl_histogram_get(hist, bar) *
- (ch->data_top - ch->data_bottom) / gsl_histogram_max_val(hist);
- pl_savestate_r(ch->lp);
- pl_move_r(ch->lp,ch->data_left, ch->data_bottom);
- pl_fillcolorname_r(ch->lp, ch->fill_colour);
- pl_filltype_r(ch->lp,1);
+ assert ( 0 == gsl_histogram_get_range(hist, bar, &lower, &upper));
+ assert( upper >= lower);
- pl_fboxrel_r(ch->lp,
- x_pos, 0,
- x_pos + width, height);
+ height = gsl_histogram_get(hist, bar) *
+ (ch->data_top - ch->data_bottom) / gsl_histogram_max_val(hist);
- pl_restorestate_r(ch->lp);
+ pl_savestate_r(ch->lp);
+ pl_move_r(ch->lp,ch->data_left, ch->data_bottom);
+ pl_fillcolorname_r(ch->lp, ch->fill_colour);
+ pl_filltype_r(ch->lp,1);
- {
- char buf[5];
- snprintf(buf,5,"%g",(upper + lower) / 2.0);
- draw_tick(ch, TICK_ABSCISSA,
- x_pos + width / 2.0, buf);
- }
+ pl_fboxrel_r(ch->lp,
+ x_pos, 0,
+ x_pos + width, height);
+
+ 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);
+ }
+ }
}