static void do_piechart(const struct variable *var,
const struct freq_tab *frq_tab);
-gsl_histogram *
+struct histogram *
freq_tab_to_hist(const struct freq_tab *ft, const struct variable *var);
if ( chart == GFT_HIST)
{
double d[frq_n_stats];
- struct normal_curve norm;
- gsl_histogram *hist ;
-
-
- norm.N = vf->tab.valid_cases;
+ struct histogram *hist ;
calc_stats (v, d);
- norm.mean = d[frq_mean];
- norm.stddev = d[frq_stddev];
- hist = freq_tab_to_hist(ft,v);
+ hist = freq_tab_to_hist (ft,v);
- histogram_plot(hist, var_to_string(v), &norm, normal);
+ histogram_plot_n (hist, var_to_string(v),
+ vf->tab.valid_cases,
+ d[frq_mean],
+ d[frq_stddev],
+ normal);
- gsl_histogram_free(hist);
+ statistic_destroy ((struct statistic *)hist);
}
-
if ( chart == GFT_PIE)
{
do_piechart(v_variables[i], ft);
}
-
-
cleanup_freq_tab (v);
}
vf->groups = NULL;
vf->width = var_get_width (v);
vf->print = *var_get_print_format (v);
- if (vf->width > MAX_SHORT_STRING && get_algorithm () == COMPATIBLE)
+ if (vf->width > MAX_SHORT_STRING && settings_get_algorithm () == COMPATIBLE)
{
enum fmt_type type = var_get_print_format (v)->type;
vf->width = MAX_SHORT_STRING;
double tp;
if ( percentiles[i].flag2 ) continue ;
- if ( get_algorithm() != COMPATIBLE )
+ if ( settings_get_algorithm () != COMPATIBLE )
tp =
(ft->valid_cases - 1) * percentiles[i].p;
else
double s;
double dummy;
- if ( get_algorithm() != COMPATIBLE )
+ if ( settings_get_algorithm () != COMPATIBLE )
{
s = modf((ft->valid_cases - 1) * percentiles[i].p , &dummy);
}
/* Create a gsl_histogram from a freq_tab */
-gsl_histogram *
-freq_tab_to_hist(const struct freq_tab *ft, const struct variable *var)
+struct histogram *
+freq_tab_to_hist (const struct freq_tab *ft, const struct variable *var)
{
int i;
double x_min = DBL_MAX;
double x_max = -DBL_MAX;
- gsl_histogram *hist;
+ struct statistic *hist;
const double bins = 11;
struct hsh_iterator hi;
if ( frq->value[0].f > x_max ) x_max = frq->value[0].f ;
}
- hist = histogram_create(bins, x_min, x_max);
+ hist = histogram_create (bins, x_min, x_max);
for( i = 0 ; i < ft->n_valid ; ++i )
{
frq = &ft->valid[i];
- gsl_histogram_accumulate(hist, frq->value[0].f, frq->count);
+ histogram_add ((struct histogram *)hist, frq->value[0].f, frq->count);
}
- return hist;
+ return (struct histogram *)hist;
}
{
const struct freq *frq = &frq_tab->valid[i];
+ ds_init_empty (&slices[i].label);
var_append_value_name (var, frq->value, &slices[i].label);
slices[i].magnetude = frq->count;
}