++ed by:
NGLENN

1 PAUSE user

Douglas Webb

NAME

Statistics::Histogram - Create a standard histogram for command-line display

VERSION

version 0.2

SYNOPSIS

  use Statistics::Histogram;

  my @data = <>;
  chomp @data;

  print get_histogram(\@data);

DESCRIPTION

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.

METHODS

get_histogram

  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

$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

$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

$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.

SEE ALSO

AUTHOR

Douglas Webb <doug.webb@gmail.com>

COPYRIGHT AND LICENSE

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.