# 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;