my $fi = gsl_fopen('data', 'r'); my $fo = gsl_fopen('hist', 'w'); my $h = gsl_histogram_alloc(6); my $range = [ 1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0 ]; gsl_histogram_fread($fi, $h); gsl_histogram_set_ranges($h,$range,7); gsl_histogram_fprintf($fo, $h, "%3.1f", "%3.1f"); gsl_fclose($fo); gsl_fclose($fi);