Plot coordinate pairs: Difference between revisions

Content added Content deleted
m (→‎{{header|Perl}}: improved handling of image output)
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 323: Line 323:


</pre>
</pre>

=={{header|Ada}}==
=={{header|Ada}}==


Line 376: Line 377:
end PlotCoords;
end PlotCoords;
</lang>
</lang>

=={{header|ALGOL 68}}==
=={{header|ALGOL 68}}==
{{works with|ALGOL 68|Revision 1 - extensions to standard used - PRAGMA READ and Currying}}
{{works with|ALGOL 68|Revision 1 - extensions to standard used - PRAGMA READ and Currying}}
Line 1,428: Line 1,430:
}
}
</lang>
</lang>

=={{header|jq}}==
=={{header|jq}}==
Using R (non-interactive mode)
Using R (non-interactive mode)
Line 1,850: Line 1,853:
$plot->Render(Image => $img, Xoff => 50, Yoff => 350);
$plot->Render(Image => $img, Xoff => 50, Yoff => 350);
$img->write(file => 'qsort-range-10-9.png');</lang>
$img->write(file => 'qsort-range-10-9.png');</lang>

=={{header|Perl 6}}==
{{works with|Rakudo|2018.03}}
Generate an SVG image file.
<lang perl6>use SVG;
use SVG::Plot;

my @x = 0..9;
my @y = (2.7, 2.8, 31.4, 38.1, 58.0, 76.2, 100.5, 130.0, 149.3, 180.0);

say SVG.serialize: SVG::Plot.new(
width => 512,
height => 512,
x => @x,
x-tick-step => { 1 },
min-y-axis => 0,
values => [@y,],
title => 'Coordinate Pairs',
).plot(:lines);</lang>
[[File:Coordinate-pairs-perl6.svg]]


=={{header|Phix}}==
=={{header|Phix}}==
Line 2,189: Line 2,172:
opens a new window with this image
opens a new window with this image
[[File:LinesRacket.png]]
[[File:LinesRacket.png]]

=={{header|Raku}}==
(formerly Perl 6)
{{works with|Rakudo|2018.03}}
Generate an SVG image file.
<lang perl6>use SVG;
use SVG::Plot;

my @x = 0..9;
my @y = (2.7, 2.8, 31.4, 38.1, 58.0, 76.2, 100.5, 130.0, 149.3, 180.0);

say SVG.serialize: SVG::Plot.new(
width => 512,
height => 512,
x => @x,
x-tick-step => { 1 },
min-y-axis => 0,
values => [@y,],
title => 'Coordinate Pairs',
).plot(:lines);</lang>
[[File:Coordinate-pairs-perl6.svg]]


=={{header|REXX}}==
=={{header|REXX}}==
Line 2,712: Line 2,716:
plot_coordinate_pairs x, y
plot_coordinate_pairs x, y
End Sub</lang>
End Sub</lang>

=={{header|XPL0}}==
=={{header|XPL0}}==
XPL0 does not provide a library routine for plotting graphs. An issue
XPL0 does not provide a library routine for plotting graphs. An issue