Skip to content
Perl 6 native bindings for PLplot
Perl 6
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
t Add inital project structure May 24, 2017
.travis.yml Add Travis CI May 24, 2017
META6.json More Perlish API May 24, 2017 Less whitespace May 27, 2017


Build Status Build status

This module provides Perl 6 low and high-level native bindings for PLplot.

Note: Currently work in progress and the API is being implemented one brick at a time. Help and feedback is appreciated.

PLplot is a library of subroutines that are often used to make scientific plots in various compiled languages. PLplot can also be used interactively by interpreted languages such as Octave, Python, Perl and Tcl. The current version was written primarily by Maurice J. LeBrun and Geoffrey Furnish and is licensed under LGPL.


use v6;
use Graphics::PLplot;

    device    => "png",
    file-name => "output.png"
) -> $plot  {

    # Begin plotting

    # Create a labeled box to hold the plot.
    my $y-max = 100;
        x-range => [0.0, 1.0],
        y-range => [0.0, $y-max],
        just    => 0,
        axis    => 0,
        x-axis => "x",
        y-axis => "y=100 x#u2#d",
        title  => "Simple PLplot demo of a 2D line plot",

    # Prepare data to be plotted.
    constant NSIZE = 101;
    my @points = gather {
        for 0..^NSIZE -> $i {
            my $x = Num($i) / (NSIZE - 1);
            my $y = Num($y-max * $x * $x);
            take ($x, $y);

    # Plot the data that was prepared above.

    LEAVE {

For more examples, please see the examples folder.


  • On Debian-based linux distributions, please use the following command:
$ sudo apt install libplplot-dev
  • On Mac OS X, please use the following command:
$ brew update
$ brew install plplot
  • Using zef (a module management tool bundled with Rakudo Star):
$ zef install Graphics::PLplot


  • To run tests:
$ prove -ve "perl6 -Ilib"
  • To run all tests including author tests (Please make sure Test::Meta is installed):
$ zef install Test::META
$ AUTHOR_TESTING=1 prove -e "perl6 -Ilib"


Ahmad M. Zawawi, azawawi on #perl6,



You can’t perform that action at this time.