1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#!/usr/local/bin/perl
# -*- perl -*-
use Chart::Strip;
my $img = Chart::Strip->new( title => 'Alien Experimentation on the Population of New England' );
my( $data );
$data = [];
for(my $t=10; $t<210; $t+=15){
push @$data, {
time => $^T + $t * 5000,
value => cos( $t/30 ),
min => 0,
diam => 10 * (-cos( $t/30 ) + 1.5),
};
}
$img->add_data( $data, {style => 'range', color => '00FFFF' } );
$img->add_data( $data, {style => 'points', color => '0000FF' } );
$data = [];
for(my $t=10; $t<210; $t+=15){
push @$data, {
time => $^T + $t * 5000,
value => cos( $t/30 + 1.5 ),
min => 0,
diam => 10 * (cos( $t/30 + 1.5 ) + 1.5),
};
}
$img->add_data( $data, {style => 'range', color => 'FF00FF' } );
$img->add_data( $data, {style => 'points', color => '00FF00' } );
print $img->png();
|