Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 64f1d5109310e5f55982e076ac1e0795 > files > 8

perl-SVG-Graph-Kit-0.40.200-2.mga7.noarch.rpm

#!/usr/bin/env perl
use strict;
use warnings;

use SVG::Graph::Kit;
my $data = [ [ 1,  2, 0 ],
             [ 2,  3, 1 ],
             [ 3,  5, 1 ],
             [ 4,  7, 2 ],
             [ 5, 11, 3 ],
             [ 6, 13, 5 ], ];
my $g = SVG::Graph::Kit->new(data => $data);
#print $g->draw;

my $n;
for my $dim (qw(x y z)) {
    for my $stat (qw(min max mean mode median range stdv percentile)) {
        $n = $stat eq 'percentile' ? 90 : undef; # Inspect the 90th percentile.
        printf "%s %s = %0.2f\n", $dim, $stat, $g->stat($dim, $stat, $n);
    }
}