my @data = ( ["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"], [ 1, 2, 5, 6, 3, 1.5, 1, 3, 4], [ sort { $a <=> $b } (1, 2, 5, 6, 3, 1.5, 1, 3, 4) ] ); #### # Create GD::Graph object my $graph = GD::Graph->new(400, 300); # Optionally set graph attributes $graph->set(x_label => "X Label", y_label => "Y Label"); # Create the graph itself my $gd = $graph->plot(\@data); # And output the file on STDOUT (redirect to a file, # or open a file yourself print $gd->png;