my @data = ( [0..scalar(@scores) - 1], [@scores[0..scalar(@scores) - 1]], [@bestwhite[0..scalar(@scores) - 1]], [@bestblack[0..scalar(@scores) - 1]], ); my $graph = GD::Graph::mixed->new(800, 700); $graph->set( x_label => 'Performance By Half-move', y_label => 'Scoring By Centipawn', title => 'Game Performance Graph', y_max_value => 15, y_min_value => -15, y_tick_number => 30, y_label_skip => 2, zero_axis => 1, dclrs => [qw(lgray red green)], types => [qw(bars linespoints linespoints)], ); my $gd = $graph->plot(\@data); open(IMAGE,'>image.png') or die "Couldn't open image.png:$!\n"; binmode IMAGE; print IMAGE $gd->png(); close IMAGE;