Statistics::Histogram - Create a standard histogram for command-line display
use Statistics::Histogram; my @data = <>; chomp @data; print get_histogram(\@data);
This module exports a single routine, get_histogram, which expects an array reference as its only required argument. The array should contain a sequence of numbers, and the response will be an ascii-formatted histogram, including some header lines providing statistics.
print get_histogram($array_ref); print get_histogram($array_ref, $num_bins, $use_linear_axes, $use_integral_bins);
There are three optional arguments: $num_bins, $use_linear_axes, and use_integral_bins.
$num_bins defaults to 10, and controls the maximum number of bins in the chart. Depending on the data, there may be fewer bins if there are fewer than $num_bins unique values.
$use_linear_axes defaults to false, which will create a chart with logarithmic axes. This is most useful for data derived from software timing metrics, which tend to be non-Normal and biased towards the axes.
$use_integral_bins defaults to false. If true it forces use_linear_axes and makes the bins fall on integral values. This is good for plotting time-series data, like the number of events in each hour of the day.
Douglas Webb <email@example.com>
This software is copyright (c) 2005 by Douglas Webb.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.