Plot coordinate pairs: Difference between revisions

m
→‎{{header|Perl}}: use PNG format for both libraries
m (→‎{{header|Perl}}: use PNG format for both libraries)
Line 2,287:
 
=={{header|Perl}}==
 
===GD::Graph library===
 
{{libheader|GD::Graph}}
<lang perl>use GD::Graph::points;
Line 2,294 ⟶ 2,297:
[2.7, 2.8, 31.4, 38.1, 58.0, 76.2, 100.5, 130.0, 149.3, 180.0],
);
$graph = GD::Graph::points->new(400, 300);
$gd = $graph->plot(\@data) or die $graph->error;
 
$graph = GD::Graph::points->new(400, 300);
# Save as image.
open my $fh, '>', "qsort-range-10-9.$formatpng";
$format = $graph->export_format;
open my $fh, '>', "qsort-range-10-9.$format";
binmode $fh;
print $fh $gdgraph->$formatplot(\@data)->png;
close $fh;</lang>
 
===Imager::Plot library===
{{libheader|Imager::Plot}}
<lang perl>use Imager;
2,392

edits