3 #include <gsl/gsl_histogram.h>
6 main (int argc, char **argv)
13 printf ("Usage: gsl-histogram xmin xmax n\n"
14 "Computes a histogram of the data "
15 "on stdin using n bins from xmin "
26 gsl_histogram * h = gsl_histogram_alloc (n);
27 gsl_histogram_set_ranges_uniform (h, a, b);
29 while (fscanf (stdin, "%lg", &x) == 1)
31 gsl_histogram_increment (h, x);
33 gsl_histogram_fprintf (stdout, h, "%g", "%g");
34 gsl_histogram_free (h);