Stefan Trcek > webrobot-0.81 > WWW::Webrobot::Histogram

Download:
webrobot-0.81.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

WWW::Webrobot::Histogram - Plain simple histograms

SYNOPSIS ^

 use WWW::Webrobot::Histogram;
 my $hist = WWW::Webrobot::Histogram -> new(base => 1.4142135623731);
 $hist -> add(3, 4, 5);
 $hist -> add(6, 7);
 my ($hist_neg, $hist_pos) = $hist->histogram;

DESCRIPTION ^

This module is used to calculate a logarithmic histogram from a set of data.

METHODS ^

my $histo = WWW::Webrobot::Histogram -> new

Constructor. Parameters are given as key=value>. keys are

 base
        [default: 2] base of the logarithmic scale (x-axis)
$histo->add(...)

Add values.

$histo->histogram()
 return ($hist_neg, $hist_pos)

$hist_pos is an array reference.

 $hist_pos->[$i]
        (i>=0): shows the number of elements between $base**$i and $base**($i+1).
 $hist_neg->[$i]
        (i<0): shows the number of elements between $base**(-$i) and $base**(-$i+1).
               $hist_neg->[0] is defined but invalid.
$histo->base

Get base attribute, see constructor new. NO SET METHOD!

syntax highlighting: