- 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);
-
-
- 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);
- }
-
-
-}
-
-
-
-
-void
-histogram_plot(const gsl_histogram *hist,
- const char *factorname,
- const struct normal_curve *norm, short show_normal)
-{
- int i;
- int bins;
-
- struct chart ch;
-
- bins = gsl_histogram_bins(hist);
-
- chart_initialise(&ch);
- chart_write_title(&ch, _("HISTOGRAM"));
-
- chart_write_ylabel(&ch, _("Frequency"));
- chart_write_xlabel(&ch, factorname);
-
- chart_write_yscale(&ch, 0, gsl_histogram_max_val(hist), 5);
-
- for ( i = 0 ; i < bins ; ++i )
- hist_draw_bar(&ch, hist, i);
-
- histogram_write_legend(&ch, norm);
-
- if ( show_normal )
- {
- /* Draw the normal curve */
-
- double d ;
- double x_min, x_max, not_used ;
- double abscissa_scale ;
- double ordinate_scale ;