Plot coordinate pairs: Difference between revisions

Added Perl version with GD::Graph library.
m (→‎{{header|Maxima}}: eps -> png for web)
(Added Perl version with GD::Graph library.)
Line 13:
'dot; pensize 2.4' plot magnitudes
[http://www.jsoftware.com/jwiki/RosettaCode/ExamplePlot1 Output of plot.]
 
=={{header|Perl}}==
{{libheader|GD::Graph}}
use GD::Graph::points;
@data = (
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
[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;
# Save as image.
open(OUF, ">qsort-range-10-9.png");
binmode OUF;
print OUF $gd->png;
close(OUF);
 
=={{header|Python}}==
'''Interpreter:''' [[Python]]
Anonymous user