use strict; use warnings; use GD::Graph::linespoints; for (1 .. 2) { my $g = GD::Graph::linespoints->new(100,100); $g->set( x_label => 'X Label', y_label => 'Y label', title => 'Some simple graph', y_max_value => 8, y_tick_number => 8, y_label_skip => 2 ) or die $g->error; open F,">plot$_.png" or die $!; binmode F; my $img = $g->plot( [[ 1, 2, 3, 4], [ 1 * $_, 2 * $_, 3 * $_, 4 * $_ ]] ) or die $g->error; print F $img->png; }