- if (frq.stats & FRQ_ST_MEDIAN)
- {
- frq.percentiles =
- xrealloc (frq.percentiles,
- (frq.n_percentiles + 1)
- * sizeof (*frq.percentiles));
-
- frq.percentiles[frq.n_percentiles].p = 0.50;
- frq.percentiles[frq.n_percentiles].show = true;
-
- frq.n_percentiles++;
- }
-
-
-/* Figure out which charts the user requested. */
-
- {
- if (sbc_barchart)
- msg (SW, _("Bar charts are not implemented."));
-
- if (sbc_histogram)
- {
- struct frq_chart *hist;
-
- hist = frq.hist = xmalloc (sizeof *frq.hist);
- hist->x_min = hi_min;
- hist->x_max = hi_max;
- hist->y_scale = hi_scale;
- hist->y_max = hi_scale == FRQ_FREQ ? hi_freq : hi_pcnt;
- hist->draw_normal = hi_norm != FRQ_NONORMAL;
- hist->include_missing = false;
-
- if (hist->x_min != SYSMIS && hist->x_max != SYSMIS
- && hist->x_min >= hist->x_max)
- {
- msg (SE, _("%s for histogram must be greater than or equal to %s, "
- "but %s was specified as %.15g and %s as %.15g. "
- "%s and %s will be ignored."),
- "MAX", "MIN",
- "MIN", hist->x_min,
- "MAX", hist->x_max,
- "MIN", "MAX");
- hist->x_min = hist->x_max = SYSMIS;
- }
-
- frq.percentiles =
- xrealloc (frq.percentiles,
- (frq.n_percentiles + 2)
- * sizeof (*frq.percentiles));
-
- frq.percentiles[frq.n_percentiles].p = 0.25;
- frq.percentiles[frq.n_percentiles].show = false;
-
- frq.percentiles[frq.n_percentiles + 1].p = 0.75;
- frq.percentiles[frq.n_percentiles + 1].show = false;
-
- frq.n_percentiles+=2;
- }
-
- if (sbc_piechart)
- {
- struct frq_chart *pie;
-
- pie = frq.pie = xmalloc (sizeof *frq.pie);
- pie->x_min = pie_min;
- pie->x_max = pie_max;
- pie->include_missing = pie_missing;
-
- if (pie->x_min != SYSMIS && pie->x_max != SYSMIS
- && pie->x_min >= pie->x_max)
- {
- msg (SE, _("%s for pie chart must be greater than or equal to %s, "
- "but %s was specified as %.15g and %s as %.15g. "
- "%s and %s will be ignored."),
- "MAX", "MIN",
- "MIN", pie->x_min,
- "MAX", pie->x_max,
- "MIN", "MAX");
- pie->x_min = pie->x_max = SYSMIS;
- }
- }
- }
-
- {
- int i,o;
- double previous_p = -1;
- qsort (frq.percentiles, frq.n_percentiles,
- sizeof (*frq.percentiles),
- ptile_3way);
-
- frq.n_show_percentiles = 0;
- for (i = o = 0; i < frq.n_percentiles; ++i)
- {
- frq.percentiles[o].p = frq.percentiles[i].p;
-
- if (frq.percentiles[i].show)
- frq.percentiles[o].show = true;
-
- if (frq.percentiles[i].p != previous_p)
- {
- if (frq.percentiles[i].show)
- frq.n_show_percentiles++;
-
- o++;
- }
-
- previous_p = frq.percentiles[i].p;
- }
-
- frq.n_percentiles = o;
- }