The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Graphics::PLplot - Perl interface to the PLplot plotting library

SYNOPSIS

  use Graphics::PLplot qw/ :all /;

  @x = (0..5);
  @y = map {$_ * $_} @x;

  plsdev ("xwin");
  plinit ();
  plcol0 (1);

  plenv (-0.5, 5.5, -1, 26, 0, 0);
  plline (\@x, \@y);

  plend ();

DESCRIPTION

This module provides a perl interface to the PLplot plotting library available from http://www.plplot.org. The interface is very similar to the C interface except that:

 - Arrays are passed in by reference
 - If the number of elements in an array is required by the C function
   the perl interface calculates this automatically [eg plline]
 - Return values are returned and not supplied as arguments

HELPER FUNCTIONS

The following perl helper functions are also available:

pl_Alloc2dGrid

Create a perl 2D array (technically an array of 1-D arrays) suitable for use in plimage. Returns a reference to the initialised 2D array. All elements are set to 0.0.

  $ref = pl_Alloc2dGrid( $nx, $ny );
pl_MinMax2dGrid

Given an array of arrays (e.g. like one generated by pl_Alloc2dGrid), return the min and max data value.

  ($min, $max) = pl_MinMax2dGrid( \@z );

EXAMPLES

This module is distributed with Perl versions of many of the C example files that are distributed as part of PLplot itself. They can be used to learn the Perl interface.

TODO

Most PLplot functions are implemented (albeit inefficiently for the functions requiring 2D data) but documentation needs to be improved.

SEE ALSO

The PDL::Graphics::PLplot module (distributed with PDL is more suitable for plotting large data arrays. This module exists primarily for cases where a dependency on PDL is not desirable.

The PLplot library is very similar to the PGPLOT library (see the PGPLOT module).

The Starlink::AST module provides a graphics interface to this PLplot module.

AUTHOR

Tim Jenness <t.jenness@jach.hawaii.edu>

Copyright (C) 2004 Tim Jenness. All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place,Suite 330, Boston, MA 02111-1307, USA