#
# GENERATED WITH PDL::PP from plplot.pd! Don't modify!
#
package PDL::Graphics::PLplot;

our @EXPORT_OK = qw(PL_PARSE_PARTIAL PL_PARSE_FULL PL_PARSE_QUIET PL_PARSE_NODELETE PL_PARSE_SHOWALL PL_PARSE_OVERRIDE PL_PARSE_NOPROGRAM PL_PARSE_NODASH PL_PARSE_SKIP PL_NOTSET DRAW_LINEX DRAW_LINEY DRAW_LINEXY MAG_COLOR BASE_CONT TOP_CONT SURF_CONT DRAW_SIDES FACETED MESH PL_FCI_SANS PL_FCI_MONO PLK_BackSpace PLK_Tab PLK_Linefeed PLK_Return PLK_Escape PLK_Delete PLK_Clear PLK_Pause PLK_Scroll_Lock PLK_Home PLK_Left PLK_Up PLK_Right PLK_Down PLK_Prior PLK_Next PLK_End PLK_Begin PLK_Select PLK_Print PLK_Execute PLK_Insert PLK_Undo PLK_Redo PLK_Menu PLK_Find PLK_Cancel PLK_Help PLK_Break PLK_Mode_switch PLK_script_switch PLK_Num_Lock PLK_KP_Space PLK_KP_Tab PLK_KP_Enter PLK_KP_F1 PLK_KP_F2 PLK_KP_F3 PLK_KP_F4 PLK_KP_Equal PLK_KP_Multiply PLK_KP_Add PLK_KP_Separator PLK_KP_Subtract PLK_KP_Decimal PLK_KP_Divide PLK_KP_0 PLK_KP_1 PLK_KP_2 PLK_KP_3 PLK_KP_4 PLK_KP_5 PLK_KP_6 PLK_KP_7 PLK_KP_8 PLK_KP_9 PLK_F1 PLK_F2 PLK_F3 PLK_F4 PLK_F5 PLK_F6 PLK_F7 PLK_F8 PLK_F9 PLK_F10 PLK_F11 PLK_L1 PLK_F12 PLK_L2 PLK_F13 PLK_L3 PLK_F14 PLK_L4 PLK_F15 PLK_L5 PLK_F16 PLK_L6 PLK_F17 PLK_L7 PLK_F18 PLK_L8 PLK_F19 PLK_L9 PLK_F20 PLK_L10 PLK_F21 PLK_R1 PLK_F22 PLK_R2 PLK_F23 PLK_R3 PLK_F24 PLK_R4 PLK_F25 PLK_R5 PLK_F26 PLK_R6 PLK_F27 PLK_R7 PLK_F28 PLK_R8 PLK_F29 PLK_R9 PLK_F30 PLK_R10 PLK_F31 PLK_R11 PLK_F32 PLK_R12 PLK_R13 PLK_F33 PLK_F34 PLK_R14 PLK_F35 PLK_R15 PLK_Shift_L PLK_Shift_R PLK_Control_L PLK_Control_R PLK_Caps_Lock PLK_Shift_Lock PLK_Meta_L PLK_Meta_R PLK_Alt_L PLK_Alt_R PLK_Super_L PLK_Super_R PLK_Hyper_L PLK_Hyper_R GRID_CSA GRID_DTLI GRID_NNI GRID_NNIDW GRID_NNLI GRID_NNAIDW PL_X_AXIS PL_Y_AXIS PL_Z_AXIS PL_COLORBAR_SHADE PL_COLORBAR_SHADE_LABEL PL_COLORBAR_IMAGE PL_COLORBAR_GRADIENT PL_COLORBAR_CAP_NONE PL_COLORBAR_CAP_LOW PL_COLORBAR_CAP_HIGH PL_COLORBAR_LABEL_LEFT PL_COLORBAR_LABEL_RIGHT PL_COLORBAR_LABEL_TOP PL_COLORBAR_LABEL_BOTTOM PL_LEGEND_BACKGROUND PL_LEGEND_BOUNDING_BOX PL_LEGEND_COLOR_BOX PL_LEGEND_LINE PL_LEGEND_NONE PL_LEGEND_ROW_MAJOR PL_LEGEND_SYMBOL PL_LEGEND_TEXT_LEFT PL_POSITION_BOTTOM PL_POSITION_INSIDE PL_POSITION_LEFT PL_POSITION_OUTSIDE PL_POSITION_RIGHT PL_POSITION_SUBPAGE PL_POSITION_TOP PL_POSITION_VIEWPORT plplot_use_standard_argument_order pladv plaxes plbin plbop plbox plbox3 plclear plcol0 plcol1 plcpstrm pldid2pc pldip2dc plend plend1 plenv plenv0 pleop plerrx plerry plfamadv plfill3 plflush plfont plfontld plgchr plgcompression plgdidev plgdiori plgdiplt plgfam plglevel plgpage plgra plgspa plgvpd plgvpw plgxax plgyax plgzax plinit pljoin pllab pllightsource pllsty plmtex plmtex3 plpat plprec plpsty plptex plptex3 plreplot plschr plscmap0n plscmap1n plscol0 plscolbg plscolor plscompression plsdev plgDevs plgFileDevs plsdidev plsdimap plsdiori plsdiplt plsdiplz pl_setcontlabelparam pl_setcontlabelformat plsfam plsfnam plsmaj plsmin plsori plspage plspause plsstrm plssub plssym plstar plstart plstripa plstripd plsvpa plsxax plsxwin plsyax plszax pltext plvasp plvpas plvpor plvsta plw3d plwidth plwind plsetopt plP_gpixmm plscolbga plscol0a plline plpath plcolorpoints plsmem plfbox plfbox1 plunfbox plunfbox1 plParseOpts plpoin plpoin3 plline3 plpoly3 plhist plfill plgradient plsym plsurf3d plsurf3dl plstyl plseed plrandd pltr0 pltr1 pltr2 plAllocGrid plFreeGrid plAlloc2dGrid plFree2dGrid init_pltr plmap plstring plstring3 plmeridians plshades plcont plmesh plmeshc plot3d plot3dc plscmap1l plshade1 plimage plimagefr plxormod plGetCursor plgstrm plgdev plgfnam plmkstrm plgver plstripc plgriddata plarc plstransform plslabelfunc pllegend plspal0 plspal1 plbtime plconfigtime plctime pltimefmt plsesc plvect plsvect plhlsrgb plgcol0 plgcolbg plscmap0 plscmap1 plgcol0a plgcolbga plscmap0a plscmap1a plscmap1la plgfont plsfont plcalc_world plgfci plsfci pl_cmd pl_setCairoCtx );
our %EXPORT_TAGS = (Func=>\@EXPORT_OK);

use PDL::Core;
use PDL::Exporter;
use DynaLoader;


   
   our @ISA = ( 'PDL::Exporter','DynaLoader' );
   push @PDL::Core::PP, __PACKAGE__;
   bootstrap PDL::Graphics::PLplot ;








#line 6 "plplot.pd"

use Carp qw(confess);

our $VERSION;
BEGIN {
$VERSION = '0.842';
};

=head1 NAME

PDL::Graphics::PLplot - Object-oriented interface from perl/PDL to the PLPLOT plotting library

=head1 SYNOPSIS

  use PDL;
  use PDL::Graphics::PLplot;

  my $pl = PDL::Graphics::PLplot->new (DEV => "png", FILE => "test.png");
  my $x  = sequence(10);
  my $y  = $x**2;
  $pl->xyplot($x, $y);
  $pl->close;

Only version 5.15.0+ of PLplot is fully supported, due to a C-level API change
that is invisible at PDL-level. However, the library does support installation
with PLplot 5.13.0+.

For more information on PLplot, see

 http://www.plplot.org/

Also see the test file, F<t/plplot.t> in this distribution for some working examples.

=head1 LONG NAMES

If you are annoyed by the long constructor call, consider installing the
L<aliased|aliased> CPAN package. Using C<aliased>, the above example
becomes

  use PDL;
  use aliased 'PDL::Graphics::PLplot';

  my $pl = PLplot->new (DEV => "png", FILE => "test.png");
  my $x  = sequence(10);
  # etc, as above

=head1 DESCRIPTION

This is the PDL interface to the PLplot graphics library.  It provides
a familiar 'perlish' Object Oriented interface as well as access to
the low-level PLplot commands from the C-API.

=head1 OPTIONS

The following options are supported.  Most options can be used
with any function.  A few are only supported on the call to 'new'.

=head2 Options used upon creation of a PLplot object (with 'new'):

=head3 BACKGROUND

Set the color for index 0, the plot background

=head3 DEV

Set the output device type.  To see a list of allowed types, try:

  PDL::Graphics::PLplot->new();

=for example

   PDL::Graphics::PLplot->new(DEV => 'png', FILE => 'test.png');

=head3 FILE

Set the output file or display.  For file output devices, sets
the output file name.  For graphical displays (like C<'xwin'>) sets
the name of the display, eg (C<'hostname.foobar.com:0'>)

=for example

   PDL::Graphics::PLplot->new(DEV => 'png',  FILE => 'test.png');
   PDL::Graphics::PLplot->new(DEV => 'xwin', FILE => ':0');

=head3 OPTS

Set plotting options.  See the PLplot documentation for the complete
listing of available options.  The value of C<'OPTS'> must be a hash
reference, whose keys are the names of the options.  For instance, to obtain
PostScript fonts with the ps output device, use:

=for example

   PDL::Graphics::PLplot->new(DEV => 'ps', OPTS => {drvopt => 'text=1'});

=head3 MEM

This option is used in conjunction with C<< DEV => 'mem' >>.  This option
takes as input a PDL image and allows one to 'decorate' it using PLplot.
The 'decorated' PDL image can then be written to an image file using,
for example, L<PDL::IO::Pic|PDL::IO::Pic>.  This option may not be available if
plplot does not include the 'mem' driver.

=for example

  # read in Earth image and draw an equator.
  my $pl = PDL::Graphics::PLplot->new (MEM => $earth, DEV => 'mem');
  my $x  = pdl(-180, 180);
  my $y  = zeroes(2);
  $pl->xyplot($x, $y,
              BOX => [-180,180,-90,90],
              VIEWPORT => [0.0, 1.0, 0.0, 1.0],
              XBOX => '', YBOX => '',
              PLOTTYPE => 'LINE');
  $pl->close;

=head3 FRAMECOLOR

Set color index 1, the frame color

=head3 JUST

A flag used to specify equal scale on the axes.  If this is
not specified, the default is to scale the axes to fit best on
the page.

=for example

  PDL::Graphics::PLplot->new(DEV => 'png',  FILE => 'test.png', JUST => 1);

=head3 ORIENTATION

The orientation of the plot:

  0 --   0 degrees (landscape mode)
  1 --  90 degrees (portrait mode)
  2 -- 180 degrees (seascape mode)
  3 -- 270 degrees (upside-down mode)

Intermediate values (0.2) are acceptable if you are feeling daring.

=for example

  # portrait orientation
  PDL::Graphics::PLplot->new(DEV => 'png',  FILE => 'test.png', ORIENTATION => 1);

=head3 PAGESIZE

Set the size in pixels of the output page.

=for example

  # PNG 500 by 600 pixels
  PDL::Graphics::PLplot->new(DEV => 'png',  FILE => 'test.png', PAGESIZE => [500,600]);

=head3 SUBPAGES

Set the number of sub pages in the plot, [$nx, $ny]

=for example

  # PNG 300 by 600 pixels
  # Two subpages stacked on top of one another.
  PDL::Graphics::PLplot->new(DEV => 'png',  FILE => 'test.png', PAGESIZE => [300,600],
                                              SUBPAGES => [1,2]);

=head2 Options used after initialization (after 'new')

=head3 BOX

Set the plotting box in world coordinates.  Used to explicitly
set the size of the plotting area.

=for example

 my $pl = PDL::Graphics::PLplot->new(DEV => 'png',  FILE => 'test.png');
 $pl->xyplot ($x, $y, BOX => [0,100,0,200]);

=head3 CHARSIZE

Set the size of text in multiples of the default size.
C<< CHARSIZE => 1.5 >> gives characters 1.5 times the normal size.

=head3 COLOR

Set the current color for plotting and character drawing.
Colors are specified not as color indices but as RGB triples.
Some pre-defined triples are included:

  BLACK        GREEN        WHEAT        BLUE
  RED          AQUAMARINE   GREY         BLUEVIOLET
  YELLOW       PINK         BROWN        CYAN
  TURQUOISE    MAGENTA      SALMON       WHITE
  ROYALBLUE    DEEPSKYBLUE  VIOLET       STEELBLUE1
  DEEPPINK     MAGENTA      DARKORCHID1  PALEVIOLETRED2
  TURQUOISE1   LIGHTSEAGREEN SKYBLUE     FORESTGREEN
  CHARTREUSE3  GOLD2        SIENNA1      CORAL
  HOTPINK      LIGHTCORAL   LIGHTPINK1   LIGHTGOLDENROD

=for example

 # These two are equivalent:
 $pl->xyplot ($x, $y, COLOR => 'YELLOW');
 $pl->xyplot ($x, $y, COLOR => [0,255,0]);

=head3 CONTOURLABELS

Control of labels for contour plots.

Must either be 0 (turn off contour labels), 1 (turn on default contour labels)
or a five element array:

 offset:  Offset of label from contour line (if set to 0.0, labels are printed on the lines). Default value is 0.006.
 size:    Font height for contour labels (normalized). Default value is 0.3.
 spacing: Spacing parameter for contour labels. Default value is 0.1.
 lexp:    If the contour numerical label is greater than 10^(lexp) or less than 10^(-lexp),
          then the exponential format is used. Default value of lexp is 4.
 sigdig:  Number of significant digits. Default value is 2";

=for example

 $pl->shadeplot ($z, $nsteps, BOX => [-1, 1, -1, 1], PLOTTYPE => 'CONTOUR', CONTOURLABELS => [0.004, 0.2, 0.2, 4, 2]);
 $pl->shadeplot ($z, $nsteps, BOX => [-1, 1, -1, 1], PLOTTYPE => 'CONTOUR', CONTOURLABELS => 0); # turn off labels
 $pl->shadeplot ($z, $nsteps, BOX => [-1, 1, -1, 1], PLOTTYPE => 'CONTOUR', CONTOURLABELS => 1); # use default labels

=head3 GRIDMAP

Set a user-defined grid map.  This is an X and Y vector that
tells what are the world coordinates for each pixel in $z
It is used in 'shadeplot' for non-standard mappings between the
input 2D surface to plot and the world coordinates.  For example
if your surface does not completely fill up the plotting window.

=for example

 my $z = $surface; # 2D PDL to plot (generated elsewhere)
 my $nlevels = 20;
 my ($nx, $ny) = $z->dims;
 my @zbounds = ($minx, $maxx, $miny, $maxy);

 # Map X coords linearly to X range, Y coords linearly to Y range
 my $xmap = ((sequence($nx)*(($zbounds[1] - $zbounds[0])/($nx - 1))) + $zbounds[0]);
 my $ymap = ((sequence($ny)*(($zbounds[3] - $zbounds[2])/($ny - 1))) + $zbounds[2]);
 $pl->shadeplot ($z, $nlevels, PALETTE => 'GREENRED', GRIDMAP => [$xmap, $ymap]);

=head3 GRIDMAP2

Set a user-defined two dimensional grid map.  These are 2D X and Y matrices that
tell what are the world coordinates for each pixel in $z
It is used in 'shadeplot' for non-standard mappings between the
input 2D surface to plot and the world coordinates, for example
irregular grids like polar projections.

=for example

 my $r_pts     = 40;
 my $theta_pts = 40;
 my $pi        = 4*atan2(1,1);
 my $nlevels   = 20;

 my $r     = ((sequence ($r_pts)) / ($r_pts - 1))->dummy (1, $theta_pts);
 my $z     = $r;  # or any other 2D surface to plot...
 my $theta = ((2 * $pi / ($theta_pts - 2)) * sequence ($theta_pts))->dummy (0, $r_pts);
 my $xmap  = $r * cos ($theta);
 my $ymap  = $r * sin ($theta);

 $pl->shadeplot ($z, $nlevels, PLOTTYPE => 'CONTOUR',
                               JUST     => 1,
                               BOX      => [-1,1,-1,1],
                               PALETTE  => 'GREENRED',
                               GRIDMAP2 => [$xmap, $ymap]);

=head3 LINEWIDTH

Set the line width for plotting.  Values range from 1 to a device dependent maximum.

=head3 LINESTYLE

Set the line style for plotting.  Pre-defined line styles use values 1 to 8, one being
a solid line, 2-8 being various dashed patterns.

=head3 MAJTICKSIZE

Set the length of major ticks as a fraction of the default setting.
One (default) means leave these ticks the normal size.

=head3 MINTICKSIZE

Set the length of minor ticks (and error bar terminals) as a fraction of the default setting.
One (default) means leave these ticks the normal size.

=head3 NXSUB

The number of minor tick marks between each major tick mark on the X axis.
Specify zero (default) to let PLplot compute this automatically.

=head3 NYSUB

The number of minor tick marks between each major tick mark on the Y axis.
Specify zero (default) to let PLplot compute this automatically.

=head3 PALETTE

Load pre-defined color map 1 color ranges.  Currently, values include:

  RAINBOW   -- from Red to Violet through the spectrum
  REVERSERAINBOW   -- Violet through Red
  GREYSCALE -- from black to white via grey.
  REVERSEGREYSCALE -- from white to black via grey.
  GREENRED  -- from green to red
  REDGREEN  -- from red to green

=for example

 # Plot x/y points with the z axis in color
 $pl->xyplot ($x, $y, PALETTE => 'RAINBOW', PLOTTYPE => 'POINTS', COLORMAP => $z);

=head3 PLOTTYPE

Specify which type of XY or shade plot is desired:

  LINE       -- A line
  POINTS     -- A bunch of symbols
  LINEPOINTS -- both

  or, for 'shadeplot':
  CONTOUR    -- A contour plot of 2D data
  SHADE      -- A shade plot of 2D data

=head3 STACKED_BAR_COLORS

For 'bargraph', request a stacked bar chart.
Must contain a reference to a perl list of color names or RGB triples.

=for example

 # $labels is a reference to a perl array with N x-axis labels
 # $values is an NxM PDL where M is the number of stacked bars (in this case 2,
 # since STACKED_BAR_COLORS contains two colors).
 $pl->bargraph($labels, $values, STACKED_BAR_COLORS => ['GREEN', [128,0,55]);

=head3 SUBPAGE

Set which subpage to plot on.  Subpages are numbered 1 to N.
A zero can be specified meaning 'advance to the next subpage' (just a call to
L<pladv()|/pladv>).

=for example

  my $pl = PDL::Graphics::PLplot->new(DEV      => 'png',
                                        FILE     => 'test.png',
                                        SUBPAGES => [1,2]);
  $pl->xyplot ($x, $y, SUBPAGE => 1);
  $pl->xyplot ($a, $b, SUBPAGE => 2);

=head3 SYMBOL

Specify which symbol to use when plotting C<< PLOTTYPE => 'POINTS' >>.
A large variety of symbols are available, see:
http://plplot.sourceforge.net/examples-data/demo07/x07.*.png, where * is 01 - 17.
You are most likely to find good plotting symbols in the 800s:
http://plplot.sourceforge.net/examples-data/demo07/x07.06.png

=head3 SYMBOLSIZE

Specify the size of symbols plotted in multiples of the default size (1).
Value are real numbers from 0 to large.

=head3 TEXTPOSITION

Specify the placement of text.  Either relative to border, specified as:

 [$side, $disp, $pos, $just]

Where

  side = 't', 'b', 'l', or 'r' for top, bottom, left and right
  disp is the number of character heights out from the edge
  pos  is the position along the edge of the viewport, from 0 to 1.
  just tells where the reference point of the string is: 0 = left, 1 = right, 0.5 = center.

or inside the plot window, specified as:

 [$x, $y, $dx, $dy, $just]

Where

  x  = x coordinate of reference point of string.
  y  = y coordinate of reference point of string.
  dx   Together with dy, this specifies the inclination of the string.
       The baseline of the string is parallel to a line joining (x, y) to (x+dx, y+dy).
  dy   Together with dx, this specifies the inclination of the string.
  just Specifies the position of the string relative to its reference point.
       If just=0, the reference point is at the left and if just=1,
       it is at the right of the string. Other values of just give
       intermediate justifications.

=for example

 # Plot text on top of plot
 $pl->text ("Top label",  TEXTPOSITION => ['t', 4.0, 0.5, 0.5]);

 # Plot text in plotting area
 $pl->text ("Line label", TEXTPOSITION => [50, 60, 5, 5, 0.5]);

=head3 TITLE

Add a title on top of a plot.

=for example

 # Plot text on top of plot
 $pl->xyplot ($x, $y, TITLE => 'X vs. Y');

=head3 UNFILLED_BARS

For 'bargraph', if set to true then plot the bars as outlines
in the current color and not as filled boxes

=for example

 # Plot text on top of plot
 $pl->bargraph($labels, $values, UNFILLED_BARS => 1);

=head3 VIEWPORT

Set the location of the plotting window on the page.
Takes a four element array ref specifying:

 xmin -- The coordinate of the left-hand edge of the viewport. (0 to 1)
 xmax -- The coordinate of the right-hand edge of the viewport. (0 to 1)
 ymin -- The coordinate of the bottom edge of the viewport. (0 to 1)
 ymax -- The coordinate of the top edge of the viewport. (0 to 1)

You will need to use this to make color keys or insets.

=for example

 # Make a small plotting window in the lower left of the page
 $pl->xyplot ($x, $y, VIEWPORT => [0.1, 0.5, 0.1, 0.5]);

 # Also useful in creating color keys:
 $pl->xyplot   ($x, $y, PALETTE => 'RAINBOW', PLOTTYPE => 'POINTS', COLORMAP => $z);
 $pl->colorkey ($z, 'v', VIEWPORT => [0.93, 0.96, 0.15, 0.85]);

 # Plot an inset; first the primary data and then the inset. In this
 # case, the inset contains a selection of the orignal data
 $pl->xyplot ($x, $y);
 $pl->xyplot (where($x, $y, $x < 1.2), VIEWPORT => [0.7, 0.9, 0.6, 0.8]);

=head3 XBOX

Specify how to label the X axis of the plot as a string of option letters:

  a: Draws axis, X-axis is horizontal line (y=0), and Y-axis is vertical line (x=0).
  b: Draws bottom (X) or left (Y) edge of frame.
  c: Draws top (X) or right (Y) edge of frame.
  d: Plot labels as date / time. Values are assumed to be seconds since the epoch (as used by gmtime).
  f: Always use fixed point numeric labels.
  g: Draws a grid at the major tick interval.
  h: Draws a grid at the minor tick interval.
  i: Inverts tick marks, so they are drawn outwards, rather than inwards.
  l: Labels axis logarithmically. This only affects the labels, not the data,
     and so it is necessary to compute the logarithms of data points before
     passing them to any of the drawing routines.
  m: Writes numeric labels at major tick intervals in the
     unconventional location (above box for X, right of box for Y).
  n: Writes numeric labels at major tick intervals in the conventional location
     (below box for X, left of box for Y).
  s: Enables subticks between major ticks, only valid if t is also specified.
  t: Draws major ticks.

The default is C<'BCNST'> which draws lines around the plot, draws major and minor
ticks and labels major ticks.

=for example

 # plot two lines in a box with independent X axes labeled
 # differently on top and bottom
 $pl->xyplot($x1, $y, XBOX  => 'bnst',  # bottom line, bottom numbers, ticks, subticks
	              YBOX  => 'bnst'); # left line, left numbers, ticks, subticks
 $pl->xyplot($x2, $y, XBOX => 'cmst', # top line, top numbers, ticks, subticks
	              YBOX => 'cst',  # right line, ticks, subticks
	              BOX => [$x2->minmax, $y->minmax]);

=head3 XERRORBAR

Used only with L</xyplot>.  Draws horizontal error bars at all points (C<$x>, C<$y>) in the plot.
Specify a PDL containing the same number of points as C<$x> and C<$y>
which specifies the width of the error bar, which will be centered at (C<$x>, C<$y>).

=head3 XLAB

Specify a label for the X axis.

=head3 XTICK

Interval (in graph units/world coordinates) between major x axis tick marks.
Specify zero (default) to allow PLplot to compute this automatically.

=head3 YBOX

Specify how to label the Y axis of the plot as a string of option letters.
See L</XBOX>.

=head3 YERRORBAR

Used only for xyplot.  Draws vertical error bars at all points (C<$x>, C<$y>) in the plot.
Specify a PDL containing the same number of points as C<$x> and C<$y>
which specifies the width of the error bar, which will be centered at (C<$x>, C<$y>).

=head3 YLAB

Specify a label for the Y axis.

=head3 YTICK

Interval (in graph units/world coordinates) between major y axis tick marks.
Specify zero (default) to allow PLplot to compute this automatically.

=head3 ZRANGE

For L</xyplot> (when C<COLORMAP> is specified), for
L</shadeplot> and for L</colorkey>.
Normally, the range of the Z variable (color) is taken as
C<< $z->minmax >>.  If a different range is desired,
specify it in C<ZRANGE>, like so:

  $pl->shadeplot ($z, $nlevels, PALETTE => 'GREENRED', ZRANGE => [0,100]);

or

  $pl->xyplot ($x, $y, PALETTE  => 'RAINBOW', PLOTTYPE => 'POINTS',
	               COLORMAP => $z,        ZRANGE => [-90,-20]);
  $pl->colorkey  ($z, 'v', VIEWPORT => [0.93, 0.96, 0.13, 0.85],
                       ZRANGE => [-90,-20]);

=head1 METHODS

These are the high-level, object oriented methods for PLplot.

=head2 new

=for ref

Create an object representing a plot.

=for usage

 Arguments:
 none.

 Supported options:
 BACKGROUND
 DEV
 FILE
 FRAMECOLOR
 JUST
 PAGESIZE
 SUBPAGES

=for example

  my $pl = PDL::Graphics::PLplot->new(DEV => 'png',  FILE => 'test.png');

=head2 setparm

=for ref

Set options for a plot object.

=for usage

 Arguments:
 none.

 Supported options:
 All options except:

 BACKGROUND
 DEV
 FILE
 FRAMECOLOR
 JUST
 PAGESIZE
 SUBPAGES

(These must be set in call to 'new'.)

=for example

  $pl->setparm (TEXTSIZE => 2);

=head2 xyplot

=for ref

Plot XY lines and/or points.  Also supports color scales for points.
This function works with bad values.  If a bad value is specified for
a points plot, it is omitted.  If a bad value is specified for a line
plot, the bad value makes a gap in the line.  This is useful for
drawing maps; for example C<$x> and C<$y> can be the continent boundary
latitude and longitude.

=for usage

 Arguments:
 $x, $y

 Supported options:
 All options except:

 BACKGROUND
 DEV
 FILE
 FRAMECOLOR
 JUST
 PAGESIZE
 SUBPAGES

(These must be set in call to 'new'.)

=for example

  $pl->xyplot($x, $y, PLOTTYPE => 'POINTS', COLOR => 'BLUEVIOLET', SYMBOL => 1, SYMBOLSIZE => 4);
  $pl->xyplot($x, $y, PLOTTYPE => 'LINEPOINTS', COLOR => [50,230,30]);
  $pl->xyplot($x, $y, PALETTE => 'RAINBOW', PLOTTYPE => 'POINTS', COLORMAP => $z);

=head2 stripplots

=for ref

Plot a set of strip plots with a common X axis, but with different Y axes.
Looks like a stack of long, thin XY plots, all line up on the same X axis.

=for usage

 Arguments:
 $xs -- 1D PDL with common X axis values, length = N
 $ys -- reference to a list of 1D PDLs with Y-axis values, length = N
        or 2D PDL with N x M elements
 -- OR --
 $xs -- reference to a list of 1D PDLs with X-axis values
 $ys -- reference to a list of 1D PDLs with Y-axis values
 %opts -- Options hash

 Supported options:
 All options except:

 BACKGROUND
 DEV
 FILE
 FRAMECOLOR
 JUST
 PAGESIZE
 SUBPAGES

(These must be set in call to 'new'.)

=for example

  my $x  = sequence(20);
  my $y1  = $x**2;
  my $y2  = sqrt($x);
  my $y3  = $x**3;
  my $y4  = sin(($x/20) * 2 * $pi);
  $ys  = cat($y1, $y2, $y3, $y4);
  $pl->stripplots($x, $ys, PLOTTYPE => 'LINE', TITLE => 'functions',
                           YLAB     => ['x**2', 'sqrt(x)', 'x**3', 'sin(x/20*2pi)'],
                           COLOR    => ['GREEN', 'DEEPSKYBLUE', 'DARKORCHID1', 'DEEPPINK'], XLAB => 'X label');
  # Equivalent to above:
  $pl->stripplots($x, [$y1, $y2, $y3, $y4],
                           PLOTTYPE => 'LINE', TITLE => 'functions',
                           YLAB     => ['x**2', 'sqrt(x)', 'x**3', 'sin(x/20*2pi)'],
                           COLOR    => ['GREEN', 'DEEPSKYBLUE', 'DARKORCHID1', 'DEEPPINK'], XLAB => 'X label');

  # Here's something a bit different. Notice that different xs have
  # different lengths.
  $x1  = sequence(20);
  $y1  = $x1**2;

  $x2  = sequence(18);
  $y2  = sqrt($x2);

  $x3  = sequence(24);
  $y3  = $x3**3;

  my $x4  = sequence(27);
  $a  = ($x4/20) * 2 * $pi;
  my $y4  = sin($a);

  $xs  = [$x1, $x2, $x3, $x4];
  $ys  = [$y1, $y2, $y3, $y4];
  $pl->stripplots($xs, $ys, PLOTTYPE => 'LINE', TITLE => 'functions',
                YLAB => ['x**2', 'sqrt(x)', 'x**3', 'sin(x/20*2pi)'],
                         COLOR => ['GREEN', 'DEEPSKYBLUE', 'DARKORCHID1', 'DEEPPINK'], XLAB => 'X label');

In addition, COLOR may be specified as a reference to a list of colors.  If
this is done, the colors are applied separately to each plot.

Also, the options Y_BASE and Y_GUTTER can be specified.  Y_BASE gives the Y offset
of the bottom of the lowest plot (0-1, specified like a VIEWPORT, defaults to 0.1) and Y_GUTTER
gives the gap between the graphs (0-1, default = 0.02).

=head2 colorkey

=for ref

Plot a color key showing which color represents which value

=for usage

 Arguments:
 $range   : A PDL which tells the range of the color values
 $orientation : 'v' for vertical color key, 'h' for horizontal

 Supported options:
 All options except:

 BACKGROUND
 DEV
 FILE
 FRAMECOLOR
 JUST
 PAGESIZE
 SUBPAGES

(These must be set in call to 'new'.)

=for example

  # Plot X vs. Y with Z shown by the color.  Then plot
  # vertical key to the right of the original plot.
  $pl->xyplot ($x, $y, PALETTE => 'RAINBOW', PLOTTYPE => 'POINTS', COLORMAP => $z);
  $pl->colorkey ($z, 'v', VIEWPORT => [0.93, 0.96, 0.15, 0.85]);

=head2 shadeplot

=for ref

Create a shaded contour plot of 2D PDL 'z' with 'nsteps' contour levels.
Linear scaling is used to map the coordinates of Z(X, Y) to world coordinates
via the L</BOX> option.

=for usage

 Arguments:
 $z : A 2D PDL which contains surface values at each XY coordinate.
 $nsteps : The number of contour levels requested for the plot.

 Supported options:
 All options except:

 BACKGROUND
 DEV
 FILE
 FRAMECOLOR
 JUST
 PAGESIZE
 SUBPAGES

(These must be set in call to 'new'.)

=for example

  # vertical key to the right of the original plot.
  # The BOX must be specified to give real coordinate values to the $z array.
  $pl->shadeplot ($z, $nsteps, BOX => [-1, 1, -1, 1], PALETTE => 'RAINBOW', ZRANGE => [0,100]);
  $pl->colorkey  ($z, 'v', VIEWPORT => [0.93, 0.96, 0.15, 0.85], ZRANGE => [0,100]);

=head2 histogram

=for ref

Create a histogram of a 1-D variable.

=for usage

 Arguments:
 $x : A 1D PDL
 $nbins : The number of bins to use in the histogram.

 Supported options:
 All options except:

 BACKGROUND
 DEV
 FILE
 FRAMECOLOR
 JUST
 PAGESIZE
 SUBPAGES

(These must be set in call to 'new'.)

=for example

  $pl->histogram ($x, $nbins, BOX => [$min, $max, 0, 100]);

=head2 histogram1

=for ref

Create a histogram of a 1-D variable.  This alternative to 'histogram'
creates filled boxes and also handles Y-axis scaling better.

=for usage

 Arguments:
 $x : A 1D PDL
 $nbins : The number of bins to use in the histogram.

 Supported options:
 All options except:

 BACKGROUND
 DEV
 FILE
 FRAMECOLOR
 JUST
 PAGESIZE
 SUBPAGES

(These must be set in call to 'new'.)

=for example

  $pl->histogram1 ($x, $nbins, COLOR => 'GREEN');

=head2 bargraph

=for ref

Simple utility to plot a bar chart with labels on the X axis.
The usual options can be specified, plus one other:  MAXBARLABELS
specifies the maximum number of labels to allow on the X axis.
The default is 20.  If this value is exceeded, then every other
label is plotted.  If twice MAXBARLABELS is exceeded, then only
every third label is printed, and so on.

if UNFILLED_BARS is set to true, then plot the bars as outlines
and not as filled rectangles.

A stacked bar graph can be created if the STACKED_BAR_COLORS
option is set.  The option takes a reference to a perl list of
color names or RGB triplets.  If this option is set, then $x should
not be a 1-D PDL of N bar heights, but a 2D PDL of NxM where N is the
number of bars and M is the number of colors in STACKED_BAR_COLORS.

=for usage

 Arguments:
 $labels -- A reference to a perl list of strings.
 $values -- A PDL of values to be plotted.

 Supported options:
 All options except:

 BACKGROUND
 DEV
 FILE
 FRAMECOLOR
 JUST
 PAGESIZE
 SUBPAGES

(These must be set in call to 'new'.)

=for example

  $labels = ['one', 'two', 'three'];
  $values = pdl(1, 2, 3);

  # Note if TEXTPOSITION is specified, it must be in 4 argument mode (border mode):
  # [$side, $disp, $pos, $just]
  #
  # Where side = 't', 'b', 'l', or 'r' for top, bottom, left and right
  #              'tv', 'bv', 'lv' or 'rv' for top, bottom, left or right perpendicular to the axis.
  #
  #     disp is the number of character heights out from the edge
  #     pos  is the position along the edge of the viewport, from 0 to 1.
  #     just tells where the reference point of the string is: 0 = left, 1 = right, 0.5 = center.
  #
  # The '$pos' entry will be ignored (computed by the bargraph routine)
  $pl->bargraph($labels, $values, MAXBARLABELS => 30, TEXTPOSITION => ['bv', 0.5, 1.0, 1.0]);

  # A stacked bar chart:
  $labels = ['label1', 'label2', 'label3'];
  $values = pdl([[50,40,60],   # green bars
                 [20,10,30]]); # purple ([128, 0, 56]) bars
  $pl->bargraph ($labels, $values, STACKED_BAR_COLORS => ['GREEN', [128, 0, 56]])

=head2 text

=for ref

Write text on a plot.  Text can either be written
with respect to the borders or at an arbitrary location and angle
(see the L</TEXTPOSITION> entry).

=for usage

 Arguments:
 $t : The text.

 Supported options:
 All options except:

 BACKGROUND
 DEV
 FILE
 FRAMECOLOR
 JUST
 PAGESIZE
 SUBPAGES

(These must be set in call to 'new'.)

=for example

  $pl->text("Count", COLOR => 'PINK',
	    TEXTPOSITION => ['t', 3, 0.5, 0.5]); # top, 3 units out, string ref. pt in
                                                 # center of string, middle of axis

=head2 close

=for ref

Close a PLplot object, writing out the file and cleaning up.

=for usage

Arguments:
None

Returns:
Nothing

This closing of the PLplot object can be done explicitly though the
'close' method.  Alternatively, a DESTROY block does an automatic
close whenever the PLplot object passes out of scope.

=for example

  $pl->close;

=cut

# Colors (from rgb.txt) are stored as RGB triples
# with each value from 0-255
sub cc2t { [map {hex} split ' ', shift] }
our %_constants = (
	       BLACK          => [  0,  0,  0],
	       RED            => [240, 50, 50],
	       YELLOW         => [255,255,  0],
	       GREEN          => [  0,255,  0],
	       AQUAMARINE     => [127,255,212],
	       PINK           => [255,192,203],
	       WHEAT          => [245,222,179],
	       GREY           => [190,190,190],
	       BROWN          => [165, 42, 42],
	       BLUE           => [  0,  0,255],
	       BLUEVIOLET     => [138, 43,226],
	       CYAN           => [  0,255,255],
	       TURQUOISE      => [ 64,224,208],
	       MAGENTA        => [255,  0,255],
	       SALMON         => [250,128,114],
	       WHITE          => [255,255,255],
               ROYALBLUE      => cc2t('2B 60 DE'),
               DEEPSKYBLUE    => cc2t('3B B9 FF'),
               VIOLET         => cc2t('8D 38 C9'),
               STEELBLUE1     => cc2t('5C B3 FF'),
               DEEPPINK       => cc2t('F5 28 87'),
               MAGENTA        => cc2t('FF 00 FF'),
               DARKORCHID1    => cc2t('B0 41 FF'),
               PALEVIOLETRED2 => cc2t('E5 6E 94'),
               TURQUOISE1     => cc2t('52 F3 FF'),
               LIGHTSEAGREEN  => cc2t('3E A9 9F'),
               SKYBLUE        => cc2t('66 98 FF'),
               FORESTGREEN    => cc2t('4E 92 58'),
               CHARTREUSE3    => cc2t('6C C4 17'),
               GOLD2          => cc2t('EA C1 17'),
               SIENNA1        => cc2t('F8 74 31'),
               CORAL          => cc2t('F7 65 41'),
               HOTPINK        => cc2t('F6 60 AB'),
               LIGHTCORAL     => cc2t('E7 74 71'),
               LIGHTPINK1     => cc2t('F9 A7 B0'),
               LIGHTGOLDENROD => cc2t('EC D8 72'),
	      );

# a hash of subroutines to invoke when certain keywords are specified
# These are called with arg(0) = $self (the plot object)
#                   and arg(1) = value specified for keyword
our %_actions =
  (

   # Set color for index 0, the plot background
   BACKGROUND => sub {
     my $self  = shift;
     my $color = _color(shift);
     $self->{COLORS}[0] = $color;
     plscolbg (@$color);
   },

   # set plotting box in world coordinates
   BOX        => sub {
     my $self  = shift;
     my $box   = shift;
     die "Box must be a ref to a four element array" unless (ref($box) =~ /ARRAY/ and @$box == 4);
     $self->{BOX} = $box;
   },

   CHARSIZE   => sub { my $self = shift;
                       $self->{CHARSIZE} = $_[0];
                       plschr (0, $self->{CHARSIZE}) unless ($self->{ISNEW}); # do not call plsch from the 'new' routine.
                     },

   # maintain color map, set to specified rgb triple
   COLOR => sub {
     my $self  = shift;
     my $color = _color(shift);

     # init.
     $self->{COLORS} = [] unless exists($self->{COLORS});

     my @idx = @{$self->{COLORS}}; # map of color index (0-15) to RGB triples
     my $found = 0;
     for (my $i=2;$i<@idx;$i++) {  # map entries 0 and 1 are reserved for BACKGROUND and FRAMECOLOR
       if (_coloreq ($color, $idx[$i])) {
	 $self->{CURRENT_COLOR_IDX} = $i;
	 $found = 1;
	 plscol0 ($self->{CURRENT_COLOR_IDX}, @$color);
       }
     }
     return if ($found);

     die "Too many colors used! (max 15)" if (@{$self->{COLORS}} > 14);

     # add this color as index 2 or greater (entries 0 and 1 reserved)
     my $idx = (@{$self->{COLORS}} > 1) ? @{$self->{COLORS}} : 2;
     $self->{COLORS}[$idx]      = $color;
     $self->{CURRENT_COLOR_IDX} = $idx;
     plscol0 ($self->{CURRENT_COLOR_IDX}, @$color);
   },

   # Contour plot label parameters (see setcontlabelparam and setcontlabelformat)
   CONTOURLABELS => sub { my $self  = shift;
                          my $parms = shift; # [offset, size, spacing, lexp, sigdig], or 0 (deactivate) or 1 (activate)
                          my $defaults = [0.006, 0.3, 0.1, 4, 2];
                          if ( (ref($parms) =~ /ARRAY/) && (@$parms == 5) ) {
                            $self->{CONTOURLABELS} = $parms;
                          } elsif ($parms == 0) {
                            $self->{CONTOURLABELS} = 0;
                          } elsif ($parms == 1) {
                            $self->{CONTOURLABELS} = $defaults;
                          } else {
                            die
"Illegal contour label parameters:  Must either be 0 (turn off contour labels), 1 (turn on default contour labels)
 or a five element array:
 offset:  Offset of label from contour line (if set to 0.0, labels are printed on the lines). Default value is 0.006.
 size:    Font height for contour labels (normalized). Default value is 0.3.
 spacing: Spacing parameter for contour labels. Default value is 0.1.
 lexp:    If the contour numerical label is greater than 10^(lexp) or less than 10^(-lexp),
          then the exponential format is used. Default value of lexp is 4.
 sigdig:  Number of significant digits. Default value is 2";
                          }
   },

   # set output device type
   DEV        => sub { my $self = shift;
                       my $dev  = shift;
                       $self->{DEV} = $dev;
                       plsdev   ($dev)
                     },   # this must be specified with call to new!

   # set PDL to plot into (alternative to specifying DEV)
   MEM        => sub { my $self = shift;
		       my $pdl  = shift;
		       my $x    = $pdl->getdim(1);
		       my $y    = $pdl->getdim(2);
		       plsmem   ($x, $y, $pdl);
		     },

   # set output file
   FILE       => sub { plsfnam  ($_[1]) },   # this must be specified with call to new!

   # set color for index 1, the plot frame and text
   # set color index 1, the frame color
   FRAMECOLOR => sub {
     my $self  = shift;
     my $color = _color(shift);
     $self->{COLORS}[1] = $color;
     plscol0 (1, @$color);
   },

   GRIDMAP => sub {
     # Use a user-defined grid map if requested.  This is an X and Y vector that
     # tells what are the world coordinates for each pixel in $z
     # It is used in 'shadeplot'.
     my $self = shift;
     my $map = shift;
     die "GRIDMAP must be an array reference"            if (ref($map) !~ /ARRAY/);
     die "GRIDMAP must be a two element array reference" if (@$map != 2);
     die "GRIDMAP must contain two PDLs"                 if ( (ref($$map[0]) !~ /PDL/) || (ref($$map[1]) !~ /PDL/) );
     die "GRIDMAP must contain two 1D PDLs"              if ( ($$map[0]->dims != 1) || ($$map[1]->dims != 1) );
     $self->{GRIDMAP} = $map;
   },

   GRIDMAP2 => sub {
     # Use a user-defined grid map if requested.  These are an X and Y matrices that
     # tells what are the world coordinates for each pixel in $z
     # They are used in 'shadeplot'.
     my $self = shift;
     my $map = shift;
     die "GRIDMAP2 must be an array reference"            if (ref($map) !~ /ARRAY/);
     die "GRIDMAP2 must be a two element array reference" if (@$map != 2);
     die "GRIDMAP2 must contain two PDLs"                 if ( (ref($$map[0]) !~ /PDL/) || (ref($$map[1]) !~ /PDL/) );
     die "GRIDMAP2 must contain two 2D PDLs"              if ( ($$map[0]->dims != 2) || ($$map[1]->dims != 2) );
     $self->{GRIDMAP2} = $map;
   },

   # Set flag for equal scale axes
   JUST => sub {
     my $self  = shift;
     my $just  = shift;
     die "JUST must be 0 or 1 (defaults to 0)" unless ($just == 0 or $just == 1);
     $self->{JUST} = $just;
   },

    LINEWIDTH  => sub {
      my $self = shift;
      my $wid  = shift;
      die "LINEWIDTH must range from 0 to LARGE8" unless ($wid >= 0);
      $self->{LINEWIDTH} = $wid;
    },

   LINESTYLE  => sub {
     my $self = shift;
     my $sty  = shift;
     die "LINESTYLE must range from 1 to 8" unless ($sty >= 1 and $sty <= 8);
     $self->{LINESTYLE} = $sty;
   },

   MAJTICKSIZE  => sub {
     my $self = shift;
     my $val  = shift;
     die "MAJTICKSIZE must be greater than or equal to zero"
       unless ($val >= 0);
     plsmaj (0, $val);
   },

   MINTICKSIZE  => sub {
     my $self = shift;
     my $val  = shift;
     die "MINTICKSIZE must be greater than or equal to zero"
       unless ($val >= 0);
     plsmin (0, $val);
   },

   NXSUB  => sub {
     my $self = shift;
     my $val  = shift;
     die "NXSUB must be an integer greater than or equal to zero"
       unless ($val >= 0 and int($val) == $val);
     $self->{NXSUB} = $val;
   },

   NYSUB  => sub {
     my $self = shift;
     my $val  = shift;
     die "NYSUB must be an integer greater than or equal to zero"
       unless ($val >= 0 and int($val) == $val);
     $self->{NYSUB} = $val;
   },

   # set driver options, example for ps driver, {text => 1} is accepted
   OPTS => sub {
     my $self = shift;
     my $opts = shift;

     foreach my $opt (keys %$opts) {
       plsetopt ($opt, $$opts{$opt});
     }
   },

   # set driver options, example for ps driver, {text => 1} is accepted
   ORIENTATION => sub {
     my $self   = shift;
     my $orient = shift;

     die "Orientation must be between 0 and 4" unless ($orient >= 0 and $orient <= 4);
     $self->{ORIENTATION} = $orient;
   },

   PAGESIZE   =>
     # set plot size in mm.  Only useful in call to 'new'
     sub {
       my $self = shift;
       my $dims = shift;

       die "plot size must be a 2 element array ref:  X size in pixels, Y size in pixels"
	 if ((ref($dims) !~ /ARRAY/) || @$dims != 2);
       $self->{PAGESIZE} = $dims;
     },

   # load some pre-done color map 1 setups
   PALETTE => sub {
     my $self = shift;
     my $pal  = shift;

     my %legal = (REVERSERAINBOW => 1, REVERSEGREYSCALE => 1, REDGREEN => 1, RAINBOW => 1, GREYSCALE => 1, GREENRED => 1);
     if ($legal{$pal}) {
       $self->{PALETTE} = $pal;
       if      ($pal eq 'RAINBOW') {
	 plscmap1l (0, PDL->new(0,1), PDL->new(0,300), PDL->new(0.5, 0.5), PDL->new(1,1), PDL->new(0,0));
       } elsif ($pal eq 'REVERSERAINBOW') {
	 plscmap1l (0, PDL->new(0,1), PDL->new(270,-30), PDL->new(0.5, 0.5), PDL->new(1,1), PDL->new(0,0));
       } elsif ($pal eq 'GREYSCALE') {
	 plscmap1l (0, PDL->new(0,1), PDL->new(0,0),   PDL->new(0,1), PDL->new(0,0), PDL->new(0,0));
       } elsif ($pal eq 'REVERSEGREYSCALE') {
	 plscmap1l (0, PDL->new(0,1), PDL->new(0,0),   PDL->new(1,0), PDL->new(0,0), PDL->new(0,0));
       } elsif ($pal eq 'GREENRED') {
	 plscmap1l (0, PDL->new(0,1), PDL->new(120,0), PDL->new(0.5, 0.5), PDL->new(1,1), PDL->new(1,1));
       } elsif ($pal eq 'REDGREEN') {
	 plscmap1l (0, PDL->new(0,1), PDL->new(0,120), PDL->new(0.5, 0.5), PDL->new(1,1), PDL->new(1,1));
       }
     } else {
       die "Illegal palette name.  Legal names are: " . join (" ", keys %legal);
     }
   },

   # specify plot type (LINE, POINTS, LINEPOINTS, CONTOUR, SHADE)
   PLOTTYPE => sub {
     my $self = shift;
     my $val  = shift;

     my %legal = (LINE => 1, POINTS => 1, LINEPOINTS => 1, CONTOUR => 1, SHADE => 1);
     if ($legal{$val}) {
       $self->{PLOTTYPE} = $val;
     } else {
       die "Illegal plot type.  Legal options are: " . join (" ", keys %legal);
     }
   },

   # Specify outline bars for bargraph
   STACKED_BAR_COLORS => sub {
     my $self = shift;
     my $val  = shift;
     my $err = "STACKED_BAR_COLORS must be a reference to a perl list of color names or RGB triples";
     die $err if (ref($val) !~ /ARRAY/);
     delete $self->{STACKED_BAR_COLORS};
     foreach my $e (@$val) {
       push @{$self->{STACKED_BAR_COLORS}}, _color($e);  # Will throw an exception if this is not a legal color
     }
   },

   # specify which subpage to plot on 1-N or 0 (meaning 'next')
   SUBPAGE => sub {
     my $self = shift;
     my $val  = shift;
     my $err  = "SUBPAGE = \$npage where \$npage = 1-N or 0 (for 'next subpage')";
     if ($val >= 0) {
       $self->{SUBPAGE} = $val;
     } else {
       die $err;
     }
   },

   # specify number of sub pages [nx, ny]
   SUBPAGES => sub {
     my $self = shift;
     my $val  = shift;
     my $err  = "SUBPAGES = [\$nx, \$ny] where \$nx and \$ny are between 1 and 127";
     if (ref($val) =~ /ARRAY/ and @$val == 2) {
       my ($nx, $ny) = @$val;
       if ($nx > 0 and $nx < 128 and $ny > 0 and $ny < 128) {
	 $self->{SUBPAGES} = [$nx, $ny];
       } else {
	 die $err;
       }
     } else {
       die $err;
     }
   },

   # specify type of symbol to plot
   SYMBOL => sub {
     my $self = shift;
     my $val  = shift;

     if ($val >= 0 && $val < 3000) {
       $self->{SYMBOL} = $val;
     } else {
       die "Illegal symbol number.  Legal symbols are between 0 and 3000";
     }
   },

   SYMBOLSIZE => sub {
     my ($self, $size) = @_;
     die "symbol size must be a real number from 0 to (large)" unless ($size >= 0);
     $self->{SYMBOLSIZE} = $size;
   },

   # specify placement of text.  Either relative to border, specified as:
   # [$side, $disp, $pos, $just]
   # or
   # inside plot window, specified as:
   # [$x, $y, $dx, $dy, $just] (see POD doc for details)
   TEXTPOSITION => sub {
     my $self = shift;
     my $val  = shift;
     die "TEXTPOSITION value must be an array ref with either:
          [$side, $disp, $pos, $just] or [$x, $y, $dx, $dy, $just]"
       unless ((ref($val) =~ /ARRAY/) and ((@$val == 4) || (@$val == 5)));
     if (@$val == 4) {
       $self->{TEXTMODE} = 'border';
     } else {
       $self->{TEXTMODE} = 'plot';
     }
     $self->{TEXTPOSITION} = $val;
   },

   # draw a title for the graph
   TITLE      => sub {
     my $self = shift;
     my $text = shift;
     $self->{TITLE} = $text;
   },

   # Specify outline bars for bargraph
   UNFILLED_BARS => sub {
     my $self = shift;
     my $val  = shift;
     $self->{UNFILLED_BARS} = $val;
   },

   # set the location of the plotting window on the page
   VIEWPORT => sub {
     my $self  = shift;
     my $vp    = shift;
     die "Viewport must be a ref to a four element array"
       unless (ref($vp) =~ /ARRAY/ and @$vp == 4);
     $self->{VIEWPORT} = $vp;
   },

   # set X axis label options.  See pod for definitions.
   XBOX       => sub {
     my $self = shift;
     my $opts = lc shift;
     my @opts = split '', $opts;
     map { 'abcdfghilmnst' =~ /$_/i || die "Illegal option $_.  Only abcdfghilmnst permitted" } @opts;
     $self->{XBOX} = $opts;
   },

   # draw an X axis label for the graph
   XLAB       => sub {
     my $self = shift;
     my $text = shift;
     $self->{XLAB} = $text;
   },

   XTICK  => sub {
     my $self = shift;
     my $val  = shift;
     die "XTICK must be greater than or equal to zero"
       unless ($val >= 0);
     $self->{XTICK} = $val;
   },

     # set Y axis label options.  See pod for definitions.
   YBOX       => sub {
     my $self = shift;
     my $opts = shift;
     my @opts = split '', $opts;
     map { 'abcfghilmnstv' =~ /$_/i || die "Illegal option $_.  Only abcfghilmnstv permitted" } @opts;
     $self->{YBOX} = $opts;
   },

   # draw an Y axis label for the graph
   YLAB       => sub {
     my $self = shift;
     my $text = shift;
     $self->{YLAB} = $text;
   },

   YTICK  => sub {
     my $self = shift;
     my $val  = shift;
     die "YTICK must be greater than or equal to zero"
       unless ($val >= 0);
     $self->{YTICK} = $val;
   },

   ZRANGE  => sub {
     my $self = shift;
     my $val  = shift;
     die "ZRANGE must be a perl array ref with min and max Z values"
       unless (ref($val) =~ /ARRAY/ && @$val == 2);
     $self->{ZRANGE} = $val;
   },

);

#
## Internal utility routines
#

# handle color as string in _constants hash or [r,g,b] triple
# Input:  either color name or [r,g,b] array ref
# Output: [r,g,b] array ref or exception
sub _color {
  my $c = shift;
  if      (ref($c) =~ /ARRAY/) {
    return $c;
  } elsif ($c = $_constants{$c}) {
    return $c;
  } else {
    die "Color $c not defined";
  }
}

# return 1 if input [r,g,b] triples are equal.
sub _coloreq {
  my ($a, $b) = @_;
  for (my $i=0;$i<3;$i++) { return 0 if ($$a[$i] != $$b[$i]); }
  return 1;
}

# Initialize plotting window given the world coordinate box and
# a 'justify' flag (for equal axis scales).
sub _setwindow {

  my $self = shift;

  # choose correct subwindow
  pladv ($self->{SUBPAGE}) if (exists ($self->{SUBPAGE}));
  delete ($self->{SUBPAGE});  # get rid of SUBPAGE so future plots will stay on same
                              # page unless user asks for specific page

  my $box  = $self->{BOX} || [0,1,0,1]; # default window

  sub MAX { ($_[0] > $_[1]) ? $_[0] : $_[1]; }

  # get subpage offsets from page left/bottom of image
  my ($spxmin, $spxmax, $spymin, $spymax) = (PDL->new(0),PDL->new(0),PDL->new(0),PDL->new(0));
  plgspa($spxmin, $spxmax, $spymin, $spymax);
  $spxmin = $spxmin->at(0);
  $spxmax = $spxmax->at(0);
  $spymin = $spymin->at(0);
  $spymax = $spymax->at(0);
  my $xsize = $spxmax - $spxmin;
  my $ysize = $spymax - $spymin;

  my @vp = @{$self->{VIEWPORT}};  # view port xmin, xmax, ymin, ymax in fraction of image size

  # if JUSTify is zero, set to the user specified (or default) VIEWPORT
  if ($self->{JUST} == 0) {
    plvpor(@vp);

  # compute viewport to allow the same scales for both axes
  } else {
    my $p_def = PDL->new(0);
    my $p_ht  = PDL->new(0);
    plgchr ($p_def, $p_ht);
    $p_def = $p_def->at(0);
    my $lb = 8.0 * $p_def;
    my $rb = 5.0 * $p_def;
    my $tb = 5.0 * $p_def;
    my $bb = 5.0 * $p_def;
    my $dx = $$box[1] - $$box[0];
    my $dy = $$box[3] - $$box[2];
    my $xscale = $dx / ($xsize - $lb - $rb);
    my $yscale = $dy / ($ysize - $tb - $bb);
    my $scale  = MAX($xscale, $yscale);
    my $vpxmin = MAX($lb, 0.5 * ($xsize - $dx / $scale));
    my $vpxmax = $vpxmin + ($dx / $scale);
    my $vpymin = MAX($bb, 0.5 * ($ysize - $dy / $scale));
    my $vpymax = $vpymin + ($dy / $scale);
    plsvpa($vpxmin, $vpxmax, $vpymin, $vpymax);
    $self->{VIEWPORT} = [$vpxmin/$xsize, $vpxmax/$xsize, $vpymin/$ysize, $vpymax/$ysize];
  }

  # set up world coords in window
  plwind (@$box);

}

# Add title and axis labels.
sub _drawlabels {

  my $self = shift;

  plcol0  (1); # set to frame color
  plmtex   (2.5, 0.5, 0.5, 't', $self->{TITLE}) if ($self->{TITLE});
  plmtex   (3.0, 0.5, 0.5, 'b', $self->{XLAB})  if ($self->{XLAB});
  plmtex   (3.5, 0.5, 0.5, 'l', $self->{YLAB})  if ($self->{YLAB});
  plcol0  ($self->{CURRENT_COLOR_IDX}); # set back

}

#
## user-visible routines
#

# Pool of PLplot stream numbers.  One of these stream numbers is taken when 'new' is called
# and when the corresponding 'close' is called, it is returned to the pool.  The pool is
# just a queue:  'new' shifts stream numbers from the top of the queue, 'close' pushes them
# back on the bottom of the queue.
my @plplot_stream_pool = (0..99);

# This routine starts out a plot.  Generally one specifies
# DEV and FILE (device and output file name) as options.
sub new {
  my $type = shift;
  my $self = {};

  # set up object
  $self->{PLOTTYPE} = 'LINE';
  # $self->{CURRENT_COLOR_IDX} = 1;
  $self->{COLORS} = [];

  bless $self, $type;

  # set stream number first
  $self->{STREAMNUMBER} = shift @plplot_stream_pool;
  die "No more PLplot streams left, too many open PLplot objects!" if (!defined($self->{STREAMNUMBER}));
  plsstrm($self->{STREAMNUMBER});

  # set background and frame color first
  $self->setparm(BACKGROUND => 'WHITE',
		 FRAMECOLOR => 'BLACK');

  # set defaults, allow input options to override
  my %opts = (
	      COLOR      => 'BLACK',
	      XBOX       => 'BCNST',
	      YBOX       => 'BCNST',
	      JUST       => 0,
	      SUBPAGES   => [1,1],
	      VIEWPORT   => [0.1, 0.87, 0.13, 0.82],
	      SUBPAGE    => 0,
	      PAGESIZE   => [600, 500],
	      LINESTYLE  => 1,
              LINEWIDTH  => 0,
              SYMBOL     => 751, # a small square
	      NXSUB      => 0,
	      NYSUB      => 0,
	      ORIENTATION=> 0,
	      XTICK      => 0,
	      YTICK      => 0,
	      CHARSIZE   => 1,
	      @_);

  # apply options
  $self->{ISNEW} = 1;
  $self->setparm(%opts);
  $self->{ISNEW} = 0;

  # Do initial setup
  plspage (0, 0, @{$self->{PAGESIZE}}, 0, 0) if (defined($self->{PAGESIZE}));
  plssub (@{$self->{SUBPAGES}});
  plsfam (0, -1, -1); # fix for plplot 5.11.0
  plfontld (1); # extented symbol pages
  plscmap0n (16);   # set up color map 0 to 16 colors.  Is this needed?
  plscmap1n (128);  # set map 1 to 128 colors (should work for devices with 256 colors)
  plinit ();

  # Now (as of plplot5.11) this must be done after plinit();
  plschr   (0, $self->{CHARSIZE});

  # set page orientation
  plsdiori ($self->{ORIENTATION});

  # set up plotting box
  $self->_setwindow;

  return $self;
}

# set parameters.  Called from user directly or from other routines.
sub setparm {
  my $self = shift;

  my %opts = @_;

  # Set PLplot to right output stream
  plsstrm($self->{STREAMNUMBER});

  # apply all options
 OPTION:
  foreach my $o (keys %opts) {
    unless (exists($_actions{$o})) {
      warn "Illegal option $o, ignoring";
      next OPTION;
    }
    &{$_actions{$o}}($self, $opts{$o});
  }
}

# handle 2D plots
sub xyplot {
  my $self = shift;
  my $x    = shift;
  my $y    = shift;

  my %opts = @_;

  # Set PLplot to right output stream
  plsstrm($self->{STREAMNUMBER});

  # only process COLORMAP entries once
  my $z = $opts{COLORMAP};
  delete ($opts{COLORMAP});

  # handle ERRORBAR options
  my $xeb = $opts{XERRORBAR};
  my $yeb = $opts{YERRORBAR};
  delete ($opts{XERRORBAR});
  delete ($opts{YERRORBAR});

  # apply options
  $self->setparm(%opts);

  unless (exists($self->{BOX})) {
    $self->{BOX} = [$x->minmax, $y->minmax];
  }

  # set up viewport, subpage, world coordinates
  $self->_setwindow;

  # draw labels
  $self->_drawlabels;

  # plot box
  plcol0  (1); # set to frame color
  plbox ($self->{XTICK}, $self->{NXSUB}, $self->{YTICK}, $self->{NYSUB},
	 $self->{XBOX}, $self->{YBOX}); # !!! note out of order call

  # set the color according to the color specified in the object
  # (we don't do this as an option, because then the frame might
  # get the color requested for the line/points
  plcol0  ($self->{CURRENT_COLOR_IDX});

  # set line style for plot only (not box)
  pllsty ($self->{LINESTYLE});

  # set line width for plot only (not box)
  plwidth  ($self->{LINEWIDTH});

  # Plot lines if requested
  if  ($self->{PLOTTYPE} =~ /LINE/) {
    plline ($x, $y);
  }

  # set line width back
  plwidth  (0);

  # plot points if requested
  if ($self->{PLOTTYPE} =~ /POINTS/) {
    my $c = $self->{SYMBOL};
    unless (defined($c)) {

      # the default for $c is a PDL of ones with shape
      # equal to $x with the first dimension removed
      my $z = PDL->zeroes($x->nelem);
      $c = PDL->ones($z->zcover) unless defined($c);
    }
    plssym   (0, $self->{SYMBOLSIZE}) if (defined($self->{SYMBOLSIZE}));

    if (defined($z)) {  # if a color range plot requested
      my ($min, $max) = exists ($self->{ZRANGE}) ? @{$self->{ZRANGE}} : $z->minmax;
      plcolorpoints ($x, $y, $z, $c, $min, $max);
    } else {
      plsym ($x, $y, $c);
    }
  }

  # Plot error bars, if requested
  if (defined($xeb)) {
    # horizontal (X) error bars
    plerrx ($x->nelem, $x - $xeb/2, $x + $xeb/2, $y);
  }

  if (defined($yeb)) {
    # vertical (Y) error bars
    plerry ($y->nelem, $x, $y - $yeb/2, $y + $yeb/2);
  }

  # Flush the PLplot stream.
  plflush();
}

sub stripplots {

  my $self    = shift;
  my $xs      = shift;
  my $yargs   = shift;

  my %opts = @_;

  # NYTICK => number of y axis ticks
  my $nytick = $opts{NYTICK} || 2;
  delete ($opts{NYTICK});

  # only process COLORMAP entries once
  my $zs = $opts{COLORMAP};
  delete ($opts{COLORMAP});

  # handle XLAB, YLAB and TITLE options
  my $title = $opts{TITLE} || '';
  my $xlab  = $opts{XLAB}  || '';
  my @ylabs = defined($opts{YLAB}) && (ref($opts{YLAB}) =~ /ARRAY/) ? @{$opts{YLAB}} : ();
  delete @opts{qw(TITLE XLAB YLAB)};

  # Ensure we're dealing with an array reference
  my $ys;
  if (ref ($yargs) eq 'ARRAY') {
    $ys = $yargs;
  }
  elsif (ref ($yargs) =~ /PDL/) {
    $ys = [dog $yargs];
  }
  else {
    barf("stripplots requires that its second argument be either a 2D ndarray or\na reference to a list of 1D ndarrays, but you provided neither.");
  }

# This doesn't work because $xs can be an anonymous array, too
#  # Let's be sure the user sent us what we expected:
#  foreach (@$ys) {
#    barf ("stripplots needs to have ndarrays for its y arguments!")
#      unless (ref =~ /PDL/);
#    barf("stripplots requires that the x and y dimensions agree!")
#      unless ($_->nelem == $xs->nelem);
#  }

  my $nplots = @$ys;

  # Use list of colors, or single color.  If COLOR not specified, default to BLACK for each graph
  my @colors = (defined ($opts{COLOR}) && ref($opts{COLOR}) =~ /ARRAY/) ? @{$opts{COLOR}}
             :  defined ($opts{COLOR})                                  ? ($opts{COLOR}) x $nplots
             : ('BLACK') x $nplots;
  delete @opts{qw(COLOR)};

  my $y_base   = defined($opts{Y_BASE})   ? $opts{Y_BASE}   : 0.1;  # Y offset to start bottom plot
  my $y_gutter = defined($opts{Y_GUTTER}) ? $opts{Y_GUTTER} : 0.02; # Y gap between plots
  delete @opts{qw(Y_BASE Y_GUTTER)};

  # apply options
  $self->setparm(%opts);

  my ($xmin, $xmax);
  if (ref ($xs) =~ /PDL/) {
    ($xmin, $xmax) = $xs->minmax;
  }
  else {
    $xmin = pdl(map { $_->min } @$xs)->min;
    $xmax = pdl(map { $_->max } @$xs)->max;
  }

  SUBPAGE:
    for (my $subpage=0;$subpage<$nplots;$subpage++) {

      my $y = $ys->[$subpage];
      my $x = ref ($xs) =~ /PDL/ ? $xs : $xs->[$subpage];
      my $mask = $y->isgood;
      $y = $y->where($mask);
      $x = $x->where($mask);
      my $z = $zs->slice(":,($subpage)")->where($mask)      if (defined($zs));
      my $yeb  = $yebs->slice(":,($subpage)")->where($mask) if (defined($yebs));
      my $ylab = $ylabs[$subpage];

      my $bottomplot = ($subpage == 0);
      my $topplot    = ($subpage == $nplots-1);

      my $xbox = 'bc';
      $xbox = 'cstnb' if ($bottomplot);

      my $box = $opts{BOX};
      my $yrange = defined($box) ? $$box[3] - $$box[2] : $y->max - $y->min;
      my $del = $yrange ? $yrange * 0.05 : 1;
      my @ybounds = ($y->min - $del, $y->max + $del);
      my $ytick = ($yrange/$nytick);
      my @COLORMAP  = (COLORMAP => $z)    if defined($z);
      $self->xyplot($x, $y,
		  COLOR     => $colors[$subpage],
		  BOX       => defined($box) ? $box : [$xmin, $xmax, @ybounds],
		  XBOX      => $xbox,
		  YBOX      => 'BCNT',
                  YTICK     => $ytick,
                  MAJTICKSIZE => 0.6,
		  CHARSIZE  => 0.4,
                  @COLORMAP,
		  VIEWPORT  => [
				0.15,
				0.9,
                                $y_base             + ($subpage     * (0.8/$nplots)),
                                $y_base - $y_gutter + (($subpage+1) * (0.8/$nplots)),
				],
		  );

      $self->text($ylab,  TEXTPOSITION => ['L', 4, 0.5, 0.5], COLOR => 'BLACK', CHARSIZE => 0.6) if (defined($ylab));
      $self->text($xlab,  TEXTPOSITION => ['B', 3, 0.5, 0.5], COLOR => 'BLACK', CHARSIZE => 0.6) if ($xlab && $bottomplot);
      $self->text($title, TEXTPOSITION => ['T', 2, 0.5, 0.5], COLOR => 'BLACK', CHARSIZE => 1.3) if ($title && $topplot);

    }

}

# Draw a color key or wedge showing the scale of map1 colors
sub colorkey {
  my $self = shift;
  my $var  = shift;
  my $orientation = shift; # 'v' (for vertical) or 'h' (for horizontal)

  my %opts = @_;

  # Set PLplot to right output stream
  plsstrm($self->{STREAMNUMBER});

  # apply options
  $self->setparm(%opts);

  # set up viewport, subpage, world coordinates
  $self->_setwindow;

  # draw labels
  $self->_drawlabels;

  # Allow user to set X, Y box type for color key scale.  D. Hunt 1/7/2009
  my $xbox = exists($self->{XBOX}) ? $self->{XBOX} : 'TM';
  my $ybox = exists($self->{YBOX}) ? $self->{YBOX} : 'TM';

  my @box;

  plcol0  (1); # set to frame color

  my ($min, $max) = exists ($self->{ZRANGE}) ? @{$self->{ZRANGE}} : $var->minmax;

  # plot box
  if      ($orientation eq 'v') {
    # set world coordinates based on input variable
    @box = (0, 1, $min, $max);
    plwind (@box);
    plbox (0, 0, 0, 0, '', $ybox);  # !!! note out of order call
  } elsif ($orientation eq 'h') {
    @box = ($min, $max, 0, 1);
    plwind (@box);
    plbox (0, 0, 0, 0, $xbox, '');  # !!! note out of order call
  } else {
    die "Illegal orientation value: $orientation.  Should be 'v' (vertical) or 'h' (horizontal)";
  }

  # restore color setting
  plcol0  ($self->{CURRENT_COLOR_IDX});

  # This is the number of colors shown in the color wedge.  Make
  # this smaller for gif images as these are limited to 256 colors total.
  # D. Hunt 8/9/2006
  my $ncols = ($self->{DEV} =~ /gif/) ? 32 : 128;

  if ($orientation eq 'v') {
    my $yinc = ($box[3] - $box[2])/$ncols;
    my $y0 = $box[2];
    for (my $i=0;$i<$ncols;$i++) {
      $y0 = $box[2] + ($i * $yinc);
      my $y1 = $y0 + $yinc;
      PDL::Graphics::PLplot::plcol1($i/$ncols);

      # Instead of using plfill (which is not supported on some devices)
      # use multiple calls to plline to color in the space. D. Hunt 8/9/2006
      foreach my $inc (0..9) {
        my $frac = $inc * 0.1;
        my $y = $y0 + (($y1 - $y0) * $frac);
        PDL::Graphics::PLplot::plline (PDL->new(0,1), PDL->new($y,$y));
      }

    }
  } else {
    my $xinc = ($box[1] - $box[0])/$ncols;
    my $x0 = $box[0];
    for (my $i=0;$i<$ncols;$i++) {
      $x0 = $box[0] + ($i * $xinc);
      my $x1 = $x0 + $xinc;
      PDL::Graphics::PLplot::plcol1($i/$ncols);

      # Instead of using plfill (which is not supported on some devices)
      # use multiple calls to plline to color in the space. D. Hunt 8/9/2006
      foreach my $inc (0..9) {
        my $frac = $inc * 0.1;
        my $x = $x0 + (($x1 - $x0) * $frac);
        PDL::Graphics::PLplot::plline (PDL->new($x,$x), PDL->new(0,1));
      }

    }
  }

  # Flush the PLplot stream.
  plflush();
}

sub shadeplot {
  my $self   = shift;
  my $z      = shift;
  my $nsteps = shift;

  my %opts = @_;

  # Set PLplot to right output stream
  plsstrm($self->{STREAMNUMBER});

  # apply options
  $self->setparm(%opts);

  my ($nx, $ny) = $z->dims;

  unless (exists($self->{BOX})) {
    $self->{BOX} = [0, $nx, 0, $ny];
  }

  # set up plotting box
  $self->_setwindow;

  # draw labels
  $self->_drawlabels;

  # plot box
  plcol0  (1); # set to frame color
  plbox ($self->{XTICK}, $self->{NXSUB}, $self->{YTICK}, $self->{NYSUB},
	 $self->{XBOX}, $self->{YBOX}); # !!! note out of order call

  my ($min, $max) = exists ($self->{ZRANGE}) ? @{$self->{ZRANGE}} : $z->minmax;
  my $clevel = ((PDL->sequence($nsteps)*(($max - $min)/($nsteps-1))) + $min);

  # may add as options later.  Now use constants
  my $fill_width = 2;
  my $cont_color = 0;
  my $cont_width = 0;

  my $rectangular = 1; # only false for non-linear coord mapping (not done yet in perl)

  # Use a user-defined grid map if requested.  This is an X and Y vector that
  # tells what are the world coordinates for each pixel in $z
  # It is also possible to specify a 2D mapping for non-linear transforms.  This is specified
  # in GRIDMAP2.
  my ($xmap, $ymap, $grid, $mapping_function);
  if (exists($self->{GRIDMAP})) {
    ($xmap, $ymap) = @{$self->{GRIDMAP}};
    $grid = plAllocGrid ($xmap, $ymap);
    $mapping_function = \&pltr1;
  } elsif (exists($self->{GRIDMAP2})) {
    ($xmap, $ymap) = @{$self->{GRIDMAP2}};
    $grid = plAlloc2dGrid ($xmap, $ymap);
    $mapping_function = \&pltr2;
  } else {
    # map X coords linearly to X range, Y coords linearly to Y range
    $xmap = ((PDL->sequence($nx)*(($self->{BOX}[1] - $self->{BOX}[0])/($nx - 1))) + $self->{BOX}[0]);
    $ymap = ((PDL->sequence($ny)*(($self->{BOX}[3] - $self->{BOX}[2])/($ny - 1))) + $self->{BOX}[2]);
    $grid = plAllocGrid ($xmap, $ymap);
    $mapping_function = \&pltr1;
  }

  # Choose shade plot or contour plot
  if (defined($self->{PLOTTYPE}) && ($self->{PLOTTYPE} eq 'CONTOUR') ) {

    if (defined($self->{CONTOURLABELS}) && $self->{CONTOURLABELS}) {
      my ($offset, $size, $spacing, $lexp, $sigdig) = @{$self->{CONTOURLABELS}};
      pl_setcontlabelparam ($offset, $size, $spacing, 1); # 1 = activate
      pl_setcontlabelformat ($lexp, $sigdig);
    } else { # == 0, set labels off
      pl_setcontlabelparam (0.006, 0.3, 0.1, 0); # 0 = deactivate
    }

    plcont ($z, 1, $nx-1, 1, $ny-1, $clevel, $mapping_function, $grid);

  } else {

    plshades($z, @{$self->{BOX}}, $clevel, $fill_width,
             $cont_color, $cont_width, $rectangular,
	     0, $mapping_function, $grid);

  }

  if (exists($self->{GRIDMAP2})) {
    plFree2dGrid ($grid);
  } else {
    plFreeGrid ($grid);
  }

  # Flush the PLplot stream.
  plflush();
}

sub histogram1 {
  my $self  = shift;
  my $x     = shift;
  my $nbins = shift;

  my $n = $x->nelem;

  my ($min, $max);
  if (exists($self->{BOX})) {
    ($min, $max) = @{$self->{BOX}}[0,1];
  } else {
    ($min, $max) = $x->minmax;
  }

  my $step = ($max - $min)/$nbins;
  my ($xvals, $yvals) = PDL::hist($x,$min,$max,$step);

  $self->{BOX} = [$min, $max, 0, $yvals->max] unless (exists($self->{BOX}));

  # apply options
  my %opts = @_;
  $self->setparm(%opts);

  # set up plotting box
  $self->_setwindow;

  # draw labels
  $self->_drawlabels;

  # plot box
  plcol0  (1); # set to frame color
  plbox ('', '', '', '', 'BNTI', 'BNTI'); # !!! note out of order call

  # draw colored histogram boxes
  plcol0  ($self->{CURRENT_COLOR_IDX});
  for (my $i=0;$i<$yvals->nelem;$i++) {
    my $y  = $yvals->at($i);
    next if ($y == 0); # don't bother plotting

    my $x  = $xvals->at($i);

    my $x0 = $x - ($step/2);
    my $x1 = $x + ($step/2);
    plfill (PDL->new($x0, $x1, $x1, $x0), PDL->new(0, 0, $y, $y));
  }

  # set color to frame color
  plcol0  (1);

  # draw outline for histogram blocks
  plbin ($xvals->nelem, $xvals, $yvals, 1);  # '1' is oldbins parm:  dont call plenv!

}

sub histogram {
  my $self   = shift;
  my $x      = shift;
  my $nbins  = shift;

  my %opts = @_;

  # Set PLplot to right output stream
  plsstrm($self->{STREAMNUMBER});

  # apply options
  $self->setparm(%opts);

  my ($min, $max);
  if (exists($self->{BOX})) {
    ($min, $max) = @{$self->{BOX}}[0,1];
  } else {
    ($min, $max) = $x->minmax;
    $self->{BOX} = [$min, $max, 0, $x->nelem]; # box probably too tall!
  }

  # set up plotting box
  $self->_setwindow;

  # draw labels
  $self->_drawlabels;

  # plot box
  plcol0  (1); # set to frame color
  plbox ($self->{XTICK}, $self->{NXSUB}, $self->{YTICK}, $self->{NYSUB},
	 $self->{XBOX}, $self->{YBOX}); # !!! note out of order call

  # set line style for plot only (not box)
  pllsty ($self->{LINESTYLE});

  # set line width for plot only (not box)
  plwidth  ($self->{LINEWIDTH});

  # set color for histograms
  plcol0  ($self->{CURRENT_COLOR_IDX});

  plhist ($x, $min, $max, $nbins, 1);  # '1' is oldbins parm:  dont call plenv!

  # set line width back
  plwidth  (0);

  # Flush the PLplot stream.
  plflush();
}

sub bargraph {
  my $self   = shift;
  my $labels = shift; # ref to perl list of labels for bars
  my $values = shift; # pdl of values for bars

  my %opts = @_;

  # max number of readable labels on x axis
  my $maxlab = defined($opts{MAXBARLABELS}) ? $opts{MAXBARLABELS} : 20;
  delete ($opts{MAXBARLABELS});

  # Set PLplot to right output stream
  plsstrm($self->{STREAMNUMBER});
  my $xmax = scalar(@$labels);

  # apply options
  $self->setparm(%opts);

  my $color_stack = $self->{STACKED_BAR_COLORS} // 0; # A list of colors for a stacked bar chart

  # ymax is either the largest value in bars, or the largest total of all stacked bars
  my ($ymin, $ymax);
  if ($color_stack) {
    $ymin = 0;
    $ymax = $values->xchg(0,1)->sumover->max;
  } else {
    ($ymin, $ymax) = $values->minmax;
  }

  unless (exists($self->{BOX})) {
    $self->{BOX} = [0, $xmax, $ymin, $ymax]; # box probably too tall!
  }

  # set up plotting box
  $self->_setwindow;

  # draw labels
  $self->_drawlabels;

  # plot box
  plcol0  (1); # set to frame color
  plbox ($self->{XTICK}, $self->{NXSUB}, $self->{YTICK}, $self->{NYSUB},
	 'bc', $self->{YBOX}); # !!! note out of order call

  # Now respect TEXTPOSITION setting if TEXTMODE eq 'border'
  # This allows the user to tweak the label placement.  D. Hunt 9/4/2007
  my ($side, $disp, $foo, $just) = ('BV', 0.2, 0, 1.0);
  if (defined($self->{TEXTMODE}) && $self->{TEXTMODE} eq 'border') {
    ($side, $disp, $foo, $just) = @{$self->{TEXTPOSITION}};
  }

  # plot labels
  plschr   (0, $self->{CHARSIZE} * 0.7); # use smaller characters
  my $pos = 0;
  my $skip   = int($xmax/$maxlab) + 1;
  for (my $i=0;$i<$xmax;$i+=$skip) {
    $pos = ((0.5+$i)/$xmax);
    my $lab = $$labels[$i];
    plmtex ($disp, $pos, $just, $side, $lab); # !!! out of order parms
  }

  plcol0  ($self->{CURRENT_COLOR_IDX}); # set back to line color

  # set line style for plot only (not box)
  pllsty ($self->{LINESTYLE});

  # set line width for plot only (not box)
  plwidth  ($self->{LINEWIDTH});

  #
  ## draw bars
  #

  # Stacked bar chart
  if ($color_stack) {

    my $idx = 0;
    my $bh  = zeroes($xmax); # base height
    my $w   = ones($xmax);   # bar width
    foreach my $color (@$color_stack) {
      $self->setparm(COLOR => $color);
      plcol0 ($self->{CURRENT_COLOR_IDX}); # set to current box color
      my $x = PDL->sequence($xmax)+0.5;
      my $y = $values->slice(":,($idx)");
      if ($self->{UNFILLED_BARS}) {
        plunfbox1 ($x, $y, $bh, $w);
      } else {
        plfbox1   ($x, $y, $bh, $w);
      }
      $bh += $y;  # Increment the base height by the height of the last set of bars
      $idx++;
    }

    plcol0 ($self->{CURRENT_COLOR_IDX}); # set back to line color

  } else { # Normal bar chart

    if ($self->{UNFILLED_BARS}) {
      plunfbox (PDL->sequence($xmax)+0.5, $values);
    } else {
      plfbox (PDL->sequence($xmax)+0.5, $values);
    }

  }

  # set line width back
  plwidth  (0);

  # set char size back
  plschr (0, $self->{CHARSIZE});

  # Flush the PLplot stream.
  plflush();
}

sub text {
  my $self = shift;
  my $text = shift;

  # Set PLplot to right output stream
  plsstrm($self->{STREAMNUMBER});

  # apply options
  $self->setparm(@_);

  # set up viewport, subpage, world coordinates
  $self->_setwindow;

  # set the color according to the color specified in the object
  plcol0  ($self->{CURRENT_COLOR_IDX});

  # plot either relative to border, or inside view port
  if      ($self->{TEXTMODE} eq 'border') {
    my ($side, $disp, $pos, $just) = @{$self->{TEXTPOSITION}};
    plmtex ($disp, $pos, $just, $side, $text); # !!! out of order parms
  } elsif ($self->{TEXTMODE} eq 'plot') {
    my ($x, $y, $dx, $dy, $just) = @{$self->{TEXTPOSITION}};
    plptex ($x, $y, $dx, $dy, $just, $text);
  }

  # Flush the PLplot stream.
  plflush();
}

# Clear the current page. This should only be used with interactive devices!
sub clear {
  my $self = shift;

  # Set PLplot to right output stream
  plsstrm($self->{STREAMNUMBER});

  plclear();
  return;
}

# Get mouse click coordinates (OO version). This should only be used with interactive devices!
sub cursor {
  my $self = shift;

  # Set PLplot to right output stream
  plsstrm($self->{STREAMNUMBER});

  # Flush the stream, to make sure the plot is visible & current
  plflush();

  # Get the cursor position
  my %gin = plGetCursor();

  # Return an array with the coordinates of the mouse click
  return ($gin{"wX"}, $gin{"wY"}, $gin{"pX"}, $gin{"pY"}, $gin{"dX"}, $gin{"dY"});
}

# Explicitly close a plot and free the object
sub close {
  my $self = shift;

  # Set PLplot to right output stream
  plsstrm($self->{STREAMNUMBER});

  plend1 ();

  # Return this stream number to the pool.
  push (@plplot_stream_pool, $self->{STREAMNUMBER});
  delete $self->{STREAMNUMBER};

  return;
}
#line 2311 "PLplot.pm"


=head1 FUNCTIONS

=cut





#line 2473 "plplot.pd"

my %REORDER = (
 plaxes       => [0,1,6,2,3,7,4,5],
 plbox        => [4,0,1,5,2,3], # 4th arg -> 0th arg, 0th arg -> 1st arg, etc
 plbox3       => [6,7,0,1,8,9,2,3,10,11,4,5],
 plmtex       => [3,0,1,2,4],
 plmtex3      => [3,0,1,2,4],
 plstart      => [2,0,1],
 plstripc     => [\13,14,15,0..12,16..19],
 plmap        => [4,5,0..3],
 plmeridians  => [6,0..5], # 6th PDL arg gets sent as 0th C arg
 plshades     => [0,10,1..9,11,12],
 plshade1     => [0,15,1..14,16,17],
);
sub _reorder {
  my ($name, $int_name, $need_reorder) = splice @_, 0, 3;
  my $ordering = $REORDER{$name};
  die "Cannot find argument reordering for $name" if !defined $ordering;
  my $missing = @_ != @$ordering;
  no strict 'refs';
  return $int_name->(@_) if !$missing and !$need_reorder;
  # either need to insert output ndarray, or reorder, or both
  my ($outarg_index) = map ref($_)?$$_:(), @$ordering;
  confess "$name: wrong number of args but no output arg\n"
    if $missing and !defined $outarg_index;
  my @pdl_args = @_;
  if (!$need_reorder) {
    # args in PDL order; by definition need insert output
    splice @pdl_args, $outarg_index, 0, my $out_ndarray = PDL->null;
    $int_name->(@pdl_args);
    return $out_ndarray;
  }
  # need to reorder, might need to insert output
  my $out_ndarray;
  if ($missing) {
    $out_ndarray = PDL->null;
    my $i = 0;
    @pdl_args = map ref($_) ? $out_ndarray : $pdl_args[$i++], @$ordering;
  }
  my @pdl_indices = map ref($_)?$$_:$_, @$ordering;
  my @input_indices = 0..$#$ordering;
  @pdl_args[@pdl_indices] = @pdl_args[@input_indices];
  $int_name->(@pdl_args);
  $missing ? $out_ndarray : ();
}

# Routine for users to set normal plplot argument order
sub plplot_use_standard_argument_order {
  $PDL::Graphics::PLplot::standard_order = shift;
}

#line 2529 "plplot.pd"

=pod

The PDL low-level interface to the PLplot library closely mimics the C API.
Users are referred to the PLplot User's Manual, distributed with the source
PLplot tarball.  This manual is also available on-line at the PLplot web
site (L<http://www.plplot.org/>).

There are three differences in the way the functions are called.  The first
one is due to a limitation in the pp_def wrapper of PDL, which forces all
the non-ndarray arguments to be at the end of the arguments list.  It is
the case of strings (C<char *>) arguments in the C API.  This affects the
following functions:

  plaxes
  plbox
  plbox3
  plmtex
  plmtex3
  plstart
  plstripc
  plmap
  plmeridians
  plshades
  plshade1

This difference can be got around by a call to

  plplot_use_standard_argument_order(1);

This re-arranges the string arguments to their proper/intuitive position
compared with the C plplot interface.  This can be restored to its default
by calling:

  plplot_use_standard_argument_order(0);

The second notable different between the C and the PDL APIs is that many of
the PDL calls do not need arguments to specify the size of the the vectors
and/or matrices being passed.  These size parameters are deduced from the
size of the ndarrays, when possible and are just omitted from the C call
when translating it to perl.

The third difference has to do with output parameters.  In C these are
passed in with the input parameters.  In the perl interface, they are omitted.
For example:

C:

  pllegend(&p_legend_width, &p_legend_height,
           opt, position, x, y, plot_width, bg_color, bb_color, bb_style, nrow, ncolumn, nlegend,
           opt_array,
           text_offset, text_scale, text_spacing, text_justification,
           text_colors, (const char **)text, box_colors, box_patterns, box_scales, box_line_widths,
           line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, (const char **)symbols);

perl:

  my ($legend_width, $legend_height) =
    pllegend ($position, $opt, $x, $y, $plot_width, $bg_color, $nlegend,
    \@opt_array,
    $text_offset, $text_scale, $text_spacing, $test_justification,
    \@text_colors, \@text, \@box_colors, \@box_patterns, \@box_scales, \@line_colors,
    \@line_styles, \@line_widths, \@symbol_colors, \@symbol_scales, \@symbol_numbers, \@symbols);

Some of the API functions implemented in PDL have other specificities in
comparison with the C API and will be discussed below.

=cut
#line 2443 "PLplot.pm"


=head2 pladv

=for sig

 Signature: (int page())
 Types: (double)

=for usage

 pladv($page); # all arguments given
 $page->pladv; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<pladv> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*pladv = \&PDL::pladv;






=head2 plaxes

=for sig

 Signature: (double xzero();double yzero();double xtick();int nxsub();double ytick();int nysub(); char *xopt;char *yopt)
 Types: (double)

=for usage

 plaxes($xzero, $yzero, $xtick, $nxsub, $ytick, $nysub, $xopt, $yopt); # all arguments given
 $xzero->plaxes($yzero, $xtick, $nxsub, $ytick, $nysub, $xopt, $yopt); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plaxes> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




sub PDL::plaxes { _reorder('plaxes', 'PDL::_plaxes_int', $standard_order, @_) }



*plaxes = \&PDL::plaxes;






=head2 plbin

=for sig

 Signature: (int nbin();double x(dima);double y(dima);int center())
 Types: (double)

=for usage

 plbin($nbin, $x, $y, $center); # all arguments given
 $nbin->plbin($x, $y, $center); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plbin> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plbin = \&PDL::plbin;






=head2 plbox

=for sig

 Signature: (double xtick();int nxsub();double ytick();int nysub(); char *xopt;char *yopt)
 Types: (double)

=for usage

 plbox($xtick, $nxsub, $ytick, $nysub, $xopt, $yopt); # all arguments given
 $xtick->plbox($nxsub, $ytick, $nysub, $xopt, $yopt); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plbox> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




sub PDL::plbox { _reorder('plbox', 'PDL::_plbox_int', $standard_order, @_) }



*plbox = \&PDL::plbox;






=head2 plbox3

=for sig

 Signature: (double xtick();int nsubx();double ytick();int nsuby();double ztick();int nsubz(); char *xopt;char *xlabel;char *yopt;char *ylabel;char *zopt;char *zlabel)
 Types: (double)

=for usage

 plbox3($xtick, $nsubx, $ytick, $nsuby, $ztick, $nsubz, $xopt, $xlabel, $yopt, $ylabel, $zopt, $zlabel); # all arguments given
 $xtick->plbox3($nsubx, $ytick, $nsuby, $ztick, $nsubz, $xopt, $xlabel, $yopt, $ylabel, $zopt, $zlabel); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plbox3> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




sub PDL::plbox3 { _reorder('plbox3', 'PDL::_plbox3_int', $standard_order, @_) }



*plbox3 = \&PDL::plbox3;






=head2 plcol0

=for sig

 Signature: (int icolzero())
 Types: (double)

=for usage

 plcol0($icolzero); # all arguments given
 $icolzero->plcol0; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plcol0> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plcol0 = \&PDL::plcol0;






=head2 plcol1

=for sig

 Signature: (double colone())
 Types: (double)

=for usage

 plcol1($colone); # all arguments given
 $colone->plcol1; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plcol1> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plcol1 = \&PDL::plcol1;






=head2 plcpstrm

=for sig

 Signature: (int iplsr();int flags())
 Types: (double)

=for usage

 plcpstrm($iplsr, $flags); # all arguments given
 $iplsr->plcpstrm($flags); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plcpstrm> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plcpstrm = \&PDL::plcpstrm;






=head2 pldid2pc

=for sig

 Signature: (double xmin(dima);double ymin(dima);double xmax(dima);double ymax(dima))
 Types: (double)

=for usage

 pldid2pc($xmin, $ymin, $xmax, $ymax); # all arguments given
 $xmin->pldid2pc($ymin, $xmax, $ymax); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<pldid2pc> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*pldid2pc = \&PDL::pldid2pc;






=head2 pldip2dc

=for sig

 Signature: (double xmin(dima);double ymin(dima);double xmax(dima);double ymax(dima))
 Types: (double)

=for usage

 pldip2dc($xmin, $ymin, $xmax, $ymax); # all arguments given
 $xmin->pldip2dc($ymin, $xmax, $ymax); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<pldip2dc> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*pldip2dc = \&PDL::pldip2dc;






=head2 plenv

=for sig

 Signature: (double xmin();double xmax();double ymin();double ymax();int just();int axis())
 Types: (double)

=for usage

 plenv($xmin, $xmax, $ymin, $ymax, $just, $axis); # all arguments given
 $xmin->plenv($xmax, $ymin, $ymax, $just, $axis); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plenv> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plenv = \&PDL::plenv;






=head2 plenv0

=for sig

 Signature: (double xmin();double xmax();double ymin();double ymax();int just();int axis())
 Types: (double)

=for usage

 plenv0($xmin, $xmax, $ymin, $ymax, $just, $axis); # all arguments given
 $xmin->plenv0($xmax, $ymin, $ymax, $just, $axis); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plenv0> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plenv0 = \&PDL::plenv0;






=head2 plerrx

=for sig

 Signature: (int n();double xmin(dima);double xmax(dima);double y(dima))
 Types: (double)

=for usage

 plerrx($n, $xmin, $xmax, $y); # all arguments given
 $n->plerrx($xmin, $xmax, $y); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plerrx> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plerrx = \&PDL::plerrx;






=head2 plerry

=for sig

 Signature: (int n();double x(dima);double ymin(dima);double ymax(dima))
 Types: (double)

=for usage

 plerry($n, $x, $ymin, $ymax); # all arguments given
 $n->plerry($x, $ymin, $ymax); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plerry> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plerry = \&PDL::plerry;






=head2 plfill3

=for sig

 Signature: (int n();double x(dima);double y(dima);double z(dima))
 Types: (double)

=for usage

 plfill3($n, $x, $y, $z); # all arguments given
 $n->plfill3($x, $y, $z); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plfill3> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plfill3 = \&PDL::plfill3;






=head2 plfont

=for sig

 Signature: (int ifont())
 Types: (double)

=for usage

 plfont($ifont); # all arguments given
 $ifont->plfont; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plfont> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plfont = \&PDL::plfont;






=head2 plfontld

=for sig

 Signature: (int fnt())
 Types: (double)

=for usage

 plfontld($fnt); # all arguments given
 $fnt->plfontld; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plfontld> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plfontld = \&PDL::plfontld;






=head2 plgchr

=for sig

 Signature: (double [o]p_def();double [o]p_ht())
 Types: (double)

=for usage

 ($p_def, $p_ht) = plgchr();
 plgchr($p_def, $p_ht);      # all arguments given
 $p_def->plgchr($p_ht);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgchr> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgchr = \&PDL::plgchr;






=head2 plgcompression

=for sig

 Signature: (int [o]compression())
 Types: (double)

=for usage

 $compression = plgcompression();
 plgcompression($compression);    # all arguments given
 $compression->plgcompression;

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgcompression> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgcompression = \&PDL::plgcompression;






=head2 plgdidev

=for sig

 Signature: (double [o]p_mar();double [o]p_aspect();double [o]p_jx();double [o]p_jy())
 Types: (double)

=for usage

 ($p_mar, $p_aspect, $p_jx, $p_jy) = plgdidev();
 plgdidev($p_mar, $p_aspect, $p_jx, $p_jy);      # all arguments given
 $p_mar->plgdidev($p_aspect, $p_jx, $p_jy);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgdidev> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgdidev = \&PDL::plgdidev;






=head2 plgdiori

=for sig

 Signature: (double [o]p_rot())
 Types: (double)

=for usage

 $p_rot = plgdiori();
 plgdiori($p_rot);    # all arguments given
 $p_rot->plgdiori;

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgdiori> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgdiori = \&PDL::plgdiori;






=head2 plgdiplt

=for sig

 Signature: (double [o]p_xmin();double [o]p_ymin();double [o]p_xmax();double [o]p_ymax())
 Types: (double)

=for usage

 ($p_xmin, $p_ymin, $p_xmax, $p_ymax) = plgdiplt();
 plgdiplt($p_xmin, $p_ymin, $p_xmax, $p_ymax);      # all arguments given
 $p_xmin->plgdiplt($p_ymin, $p_xmax, $p_ymax);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgdiplt> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgdiplt = \&PDL::plgdiplt;






=head2 plgfam

=for sig

 Signature: (int [o]p_fam();int [o]p_num();int [o]p_bmax())
 Types: (double)

=for usage

 ($p_fam, $p_num, $p_bmax) = plgfam();
 plgfam($p_fam, $p_num, $p_bmax);      # all arguments given
 $p_fam->plgfam($p_num, $p_bmax);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgfam> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgfam = \&PDL::plgfam;






=head2 plglevel

=for sig

 Signature: (int [o]p_level())
 Types: (double)

=for usage

 $p_level = plglevel();
 plglevel($p_level);    # all arguments given
 $p_level->plglevel;

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plglevel> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plglevel = \&PDL::plglevel;






=head2 plgpage

=for sig

 Signature: (double [o]p_xp();double [o]p_yp();int [o]p_xleng();int [o]p_yleng();int [o]p_xoff();int [o]p_yoff())
 Types: (double)

=for usage

 ($p_xp, $p_yp, $p_xleng, $p_yleng, $p_xoff, $p_yoff) = plgpage();
 plgpage($p_xp, $p_yp, $p_xleng, $p_yleng, $p_xoff, $p_yoff);      # all arguments given
 $p_xp->plgpage($p_yp, $p_xleng, $p_yleng, $p_xoff, $p_yoff);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgpage> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgpage = \&PDL::plgpage;






=head2 plgspa

=for sig

 Signature: (double [o]xmin();double [o]xmax();double [o]ymin();double [o]ymax())
 Types: (double)

=for usage

 ($xmin, $xmax, $ymin, $ymax) = plgspa();
 plgspa($xmin, $xmax, $ymin, $ymax);      # all arguments given
 $xmin->plgspa($xmax, $ymin, $ymax);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgspa> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgspa = \&PDL::plgspa;






=head2 plgvpd

=for sig

 Signature: (double [o]p_xmin();double [o]p_xmax();double [o]p_ymin();double [o]p_ymax())
 Types: (double)

=for usage

 ($p_xmin, $p_xmax, $p_ymin, $p_ymax) = plgvpd();
 plgvpd($p_xmin, $p_xmax, $p_ymin, $p_ymax);      # all arguments given
 $p_xmin->plgvpd($p_xmax, $p_ymin, $p_ymax);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgvpd> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgvpd = \&PDL::plgvpd;






=head2 plgvpw

=for sig

 Signature: (double [o]p_xmin();double [o]p_xmax();double [o]p_ymin();double [o]p_ymax())
 Types: (double)

=for usage

 ($p_xmin, $p_xmax, $p_ymin, $p_ymax) = plgvpw();
 plgvpw($p_xmin, $p_xmax, $p_ymin, $p_ymax);      # all arguments given
 $p_xmin->plgvpw($p_xmax, $p_ymin, $p_ymax);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgvpw> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgvpw = \&PDL::plgvpw;






=head2 plgxax

=for sig

 Signature: (int [o]p_digmax();int [o]p_digits())
 Types: (double)

=for usage

 ($p_digmax, $p_digits) = plgxax();
 plgxax($p_digmax, $p_digits);      # all arguments given
 $p_digmax->plgxax($p_digits);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgxax> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgxax = \&PDL::plgxax;






=head2 plgyax

=for sig

 Signature: (int [o]p_digmax();int [o]p_digits())
 Types: (double)

=for usage

 ($p_digmax, $p_digits) = plgyax();
 plgyax($p_digmax, $p_digits);      # all arguments given
 $p_digmax->plgyax($p_digits);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgyax> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgyax = \&PDL::plgyax;






=head2 plgzax

=for sig

 Signature: (int [o]p_digmax();int [o]p_digits())
 Types: (double)

=for usage

 ($p_digmax, $p_digits) = plgzax();
 plgzax($p_digmax, $p_digits);      # all arguments given
 $p_digmax->plgzax($p_digits);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgzax> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgzax = \&PDL::plgzax;






=head2 pljoin

=for sig

 Signature: (double xone();double yone();double xtwo();double ytwo())
 Types: (double)

=for usage

 pljoin($xone, $yone, $xtwo, $ytwo); # all arguments given
 $xone->pljoin($yone, $xtwo, $ytwo); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<pljoin> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*pljoin = \&PDL::pljoin;






=head2 pllightsource

=for sig

 Signature: (double x();double y();double z())
 Types: (double)

=for usage

 pllightsource($x, $y, $z); # all arguments given
 $x->pllightsource($y, $z); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<pllightsource> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*pllightsource = \&PDL::pllightsource;






=head2 pllsty

=for sig

 Signature: (int lin())
 Types: (double)

=for usage

 pllsty($lin); # all arguments given
 $lin->pllsty; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<pllsty> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*pllsty = \&PDL::pllsty;






=head2 plmtex

=for sig

 Signature: (double disp();double pos();double just(); char *side;char *text)
 Types: (double)

=for usage

 plmtex($disp, $pos, $just, $side, $text); # all arguments given
 $disp->plmtex($pos, $just, $side, $text); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plmtex> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




sub PDL::plmtex { _reorder('plmtex', 'PDL::_plmtex_int', $standard_order, @_) }



*plmtex = \&PDL::plmtex;






=head2 plmtex3

=for sig

 Signature: (double disp();double pos();double just(); char *side;char *text)
 Types: (double)

=for usage

 plmtex3($disp, $pos, $just, $side, $text); # all arguments given
 $disp->plmtex3($pos, $just, $side, $text); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plmtex3> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




sub PDL::plmtex3 { _reorder('plmtex3', 'PDL::_plmtex3_int', $standard_order, @_) }



*plmtex3 = \&PDL::plmtex3;






=head2 plpat

=for sig

 Signature: (int nlin();int inc(dima);int del(dima))
 Types: (double)

=for usage

 plpat($nlin, $inc, $del); # all arguments given
 $nlin->plpat($inc, $del); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plpat> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plpat = \&PDL::plpat;






=head2 plprec

=for sig

 Signature: (int setp();int prec())
 Types: (double)

=for usage

 plprec($setp, $prec); # all arguments given
 $setp->plprec($prec); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plprec> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plprec = \&PDL::plprec;






=head2 plpsty

=for sig

 Signature: (int patt())
 Types: (double)

=for usage

 plpsty($patt); # all arguments given
 $patt->plpsty; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plpsty> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plpsty = \&PDL::plpsty;






=head2 plptex

=for sig

 Signature: (double x();double y();double dx();double dy();double just(); char *text)
 Types: (double)

=for usage

 plptex($x, $y, $dx, $dy, $just, $text); # all arguments given
 $x->plptex($y, $dx, $dy, $just, $text); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plptex> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plptex = \&PDL::plptex;






=head2 plptex3

=for sig

 Signature: (double x();double y();double z();double dx();double dy();double dz();double sx();double sy();double sz();double just(); char *text)
 Types: (double)

=for usage

 plptex3($x, $y, $z, $dx, $dy, $dz, $sx, $sy, $sz, $just, $text); # all arguments given
 $x->plptex3($y, $z, $dx, $dy, $dz, $sx, $sy, $sz, $just, $text); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plptex3> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plptex3 = \&PDL::plptex3;






=head2 plschr

=for sig

 Signature: (double def();double scale())
 Types: (double)

=for usage

 plschr($def, $scale); # all arguments given
 $def->plschr($scale); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plschr> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plschr = \&PDL::plschr;






=head2 plscmap0n

=for sig

 Signature: (int ncolzero())
 Types: (double)

=for usage

 plscmap0n($ncolzero); # all arguments given
 $ncolzero->plscmap0n; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscmap0n> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscmap0n = \&PDL::plscmap0n;






=head2 plscmap1n

=for sig

 Signature: (int ncolone())
 Types: (double)

=for usage

 plscmap1n($ncolone); # all arguments given
 $ncolone->plscmap1n; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscmap1n> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscmap1n = \&PDL::plscmap1n;






=head2 plscol0

=for sig

 Signature: (int icolzero();int r();int g();int b())
 Types: (double)

=for usage

 plscol0($icolzero, $r, $g, $b); # all arguments given
 $icolzero->plscol0($r, $g, $b); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscol0> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscol0 = \&PDL::plscol0;






=head2 plscolbg

=for sig

 Signature: (int r();int g();int b())
 Types: (double)

=for usage

 plscolbg($r, $g, $b); # all arguments given
 $r->plscolbg($g, $b); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscolbg> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscolbg = \&PDL::plscolbg;






=head2 plscolor

=for sig

 Signature: (int color())
 Types: (double)

=for usage

 plscolor($color); # all arguments given
 $color->plscolor; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscolor> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscolor = \&PDL::plscolor;






=head2 plscompression

=for sig

 Signature: (int compression())
 Types: (double)

=for usage

 plscompression($compression); # all arguments given
 $compression->plscompression; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscompression> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscompression = \&PDL::plscompression;





#line 3109 "plplot.pd"

=head2 plgDevs

=for sig

  $devices = plgDevs ()

=for ref

Returns a HashRef of all device names (key)
and their menu strings (value).

=cut

#line 3109 "plplot.pd"

=head2 plgFileDevs

=for sig

  $devices = plgFileDevs ()

=for ref

Returns a HashRef of file-oriented device names (key)
and their menu strings (value).

=cut
#line 4332 "PLplot.pm"


=head2 plsdidev

=for sig

 Signature: (double mar();double aspect();double jx();double jy())
 Types: (double)

=for usage

 plsdidev($mar, $aspect, $jx, $jy); # all arguments given
 $mar->plsdidev($aspect, $jx, $jy); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsdidev> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsdidev = \&PDL::plsdidev;






=head2 plsdimap

=for sig

 Signature: (int dimxmin();int dimxmax();int dimymin();int dimymax();double dimxpmm();double dimypmm())
 Types: (double)

=for usage

 plsdimap($dimxmin, $dimxmax, $dimymin, $dimymax, $dimxpmm, $dimypmm); # all arguments given
 $dimxmin->plsdimap($dimxmax, $dimymin, $dimymax, $dimxpmm, $dimypmm); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsdimap> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsdimap = \&PDL::plsdimap;






=head2 plsdiori

=for sig

 Signature: (double rot())
 Types: (double)

=for usage

 plsdiori($rot); # all arguments given
 $rot->plsdiori; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsdiori> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsdiori = \&PDL::plsdiori;






=head2 plsdiplt

=for sig

 Signature: (double xmin();double ymin();double xmax();double ymax())
 Types: (double)

=for usage

 plsdiplt($xmin, $ymin, $xmax, $ymax); # all arguments given
 $xmin->plsdiplt($ymin, $xmax, $ymax); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsdiplt> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsdiplt = \&PDL::plsdiplt;






=head2 plsdiplz

=for sig

 Signature: (double xmin();double ymin();double xmax();double ymax())
 Types: (double)

=for usage

 plsdiplz($xmin, $ymin, $xmax, $ymax); # all arguments given
 $xmin->plsdiplz($ymin, $xmax, $ymax); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsdiplz> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsdiplz = \&PDL::plsdiplz;






=head2 pl_setcontlabelparam

=for sig

 Signature: (double offset();double size();double spacing();int active())
 Types: (double)

=for usage

 pl_setcontlabelparam($offset, $size, $spacing, $active); # all arguments given
 $offset->pl_setcontlabelparam($size, $spacing, $active); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<pl_setcontlabelparam> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*pl_setcontlabelparam = \&PDL::pl_setcontlabelparam;






=head2 pl_setcontlabelformat

=for sig

 Signature: (int lexp();int sigdig())
 Types: (double)

=for usage

 pl_setcontlabelformat($lexp, $sigdig); # all arguments given
 $lexp->pl_setcontlabelformat($sigdig); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<pl_setcontlabelformat> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*pl_setcontlabelformat = \&PDL::pl_setcontlabelformat;






=head2 plsfam

=for sig

 Signature: (int fam();int num();int bmax())
 Types: (double)

=for usage

 plsfam($fam, $num, $bmax); # all arguments given
 $fam->plsfam($num, $bmax); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsfam> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsfam = \&PDL::plsfam;






=head2 plsmaj

=for sig

 Signature: (double def();double scale())
 Types: (double)

=for usage

 plsmaj($def, $scale); # all arguments given
 $def->plsmaj($scale); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsmaj> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsmaj = \&PDL::plsmaj;






=head2 plsmin

=for sig

 Signature: (double def();double scale())
 Types: (double)

=for usage

 plsmin($def, $scale); # all arguments given
 $def->plsmin($scale); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsmin> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsmin = \&PDL::plsmin;






=head2 plsori

=for sig

 Signature: (int ori())
 Types: (double)

=for usage

 plsori($ori); # all arguments given
 $ori->plsori; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsori> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsori = \&PDL::plsori;






=head2 plspage

=for sig

 Signature: (double xp();double yp();int xleng();int yleng();int xoff();int yoff())
 Types: (double)

=for usage

 plspage($xp, $yp, $xleng, $yleng, $xoff, $yoff); # all arguments given
 $xp->plspage($yp, $xleng, $yleng, $xoff, $yoff); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plspage> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plspage = \&PDL::plspage;






=head2 plspause

=for sig

 Signature: (int pause())
 Types: (double)

=for usage

 plspause($pause); # all arguments given
 $pause->plspause; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plspause> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plspause = \&PDL::plspause;






=head2 plsstrm

=for sig

 Signature: (int strm())
 Types: (double)

=for usage

 plsstrm($strm); # all arguments given
 $strm->plsstrm; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsstrm> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsstrm = \&PDL::plsstrm;






=head2 plssub

=for sig

 Signature: (int nx();int ny())
 Types: (double)

=for usage

 plssub($nx, $ny); # all arguments given
 $nx->plssub($ny); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plssub> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plssub = \&PDL::plssub;






=head2 plssym

=for sig

 Signature: (double def();double scale())
 Types: (double)

=for usage

 plssym($def, $scale); # all arguments given
 $def->plssym($scale); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plssym> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plssym = \&PDL::plssym;






=head2 plstar

=for sig

 Signature: (int nx();int ny())
 Types: (double)

=for usage

 plstar($nx, $ny); # all arguments given
 $nx->plstar($ny); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plstar> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plstar = \&PDL::plstar;






=head2 plstart

=for sig

 Signature: (int nx();int ny(); char *devname)
 Types: (double)

=for usage

 plstart($nx, $ny, $devname); # all arguments given
 $nx->plstart($ny, $devname); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plstart> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




sub PDL::plstart { _reorder('plstart', 'PDL::_plstart_int', $standard_order, @_) }



*plstart = \&PDL::plstart;






=head2 plstripa

=for sig

 Signature: (int id();int pen();double x();double y())
 Types: (double)

=for usage

 plstripa($id, $pen, $x, $y); # all arguments given
 $id->plstripa($pen, $x, $y); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plstripa> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plstripa = \&PDL::plstripa;






=head2 plstripd

=for sig

 Signature: (int id())
 Types: (double)

=for usage

 plstripd($id); # all arguments given
 $id->plstripd; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plstripd> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plstripd = \&PDL::plstripd;






=head2 plsvpa

=for sig

 Signature: (double xmin();double xmax();double ymin();double ymax())
 Types: (double)

=for usage

 plsvpa($xmin, $xmax, $ymin, $ymax); # all arguments given
 $xmin->plsvpa($xmax, $ymin, $ymax); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsvpa> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsvpa = \&PDL::plsvpa;






=head2 plsxax

=for sig

 Signature: (int digmax();int digits())
 Types: (double)

=for usage

 plsxax($digmax, $digits); # all arguments given
 $digmax->plsxax($digits); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsxax> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsxax = \&PDL::plsxax;






=head2 plsxwin

=for sig

 Signature: (int window_id())
 Types: (double)

=for usage

 plsxwin($window_id); # all arguments given
 $window_id->plsxwin; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsxwin> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsxwin = \&PDL::plsxwin;






=head2 plsyax

=for sig

 Signature: (int digmax();int digits())
 Types: (double)

=for usage

 plsyax($digmax, $digits); # all arguments given
 $digmax->plsyax($digits); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsyax> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsyax = \&PDL::plsyax;






=head2 plszax

=for sig

 Signature: (int digmax();int digits())
 Types: (double)

=for usage

 plszax($digmax, $digits); # all arguments given
 $digmax->plszax($digits); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plszax> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plszax = \&PDL::plszax;






=head2 plvasp

=for sig

 Signature: (double aspect())
 Types: (double)

=for usage

 plvasp($aspect); # all arguments given
 $aspect->plvasp; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plvasp> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plvasp = \&PDL::plvasp;






=head2 plvpas

=for sig

 Signature: (double xmin();double xmax();double ymin();double ymax();double aspect())
 Types: (double)

=for usage

 plvpas($xmin, $xmax, $ymin, $ymax, $aspect); # all arguments given
 $xmin->plvpas($xmax, $ymin, $ymax, $aspect); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plvpas> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plvpas = \&PDL::plvpas;






=head2 plvpor

=for sig

 Signature: (double xmin();double xmax();double ymin();double ymax())
 Types: (double)

=for usage

 plvpor($xmin, $xmax, $ymin, $ymax); # all arguments given
 $xmin->plvpor($xmax, $ymin, $ymax); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plvpor> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plvpor = \&PDL::plvpor;






=head2 plw3d

=for sig

 Signature: (double basex();double basey();double height();double xminzero();double xmaxzero();double yminzero();double ymaxzero();double zminzero();double zmaxzero();double alt();double az())
 Types: (double)

=for usage

 plw3d($basex, $basey, $height, $xminzero, $xmaxzero, $yminzero, $ymaxzero, $zminzero, $zmaxzero, $alt, $az); # all arguments given
 $basex->plw3d($basey, $height, $xminzero, $xmaxzero, $yminzero, $ymaxzero, $zminzero, $zmaxzero, $alt, $az); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plw3d> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plw3d = \&PDL::plw3d;






=head2 plwidth

=for sig

 Signature: (int width())
 Types: (double)

=for usage

 plwidth($width); # all arguments given
 $width->plwidth; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plwidth> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plwidth = \&PDL::plwidth;






=head2 plwind

=for sig

 Signature: (double xmin();double xmax();double ymin();double ymax())
 Types: (double)

=for usage

 plwind($xmin, $xmax, $ymin, $ymax); # all arguments given
 $xmin->plwind($xmax, $ymin, $ymax); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plwind> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plwind = \&PDL::plwind;






=head2 plP_gpixmm

=for sig

 Signature: (double p_x(dima);double p_y(dima))
 Types: (double)

=for usage

 plP_gpixmm($p_x, $p_y); # all arguments given
 $p_x->plP_gpixmm($p_y); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plP_gpixmm> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plP_gpixmm = \&PDL::plP_gpixmm;






=head2 plscolbga

=for sig

 Signature: (int r();int g();int b();double a())
 Types: (double)

=for usage

 plscolbga($r, $g, $b, $a); # all arguments given
 $r->plscolbga($g, $b, $a); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscolbga> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscolbga = \&PDL::plscolbga;






=head2 plscol0a

=for sig

 Signature: (int icolzero();int r();int g();int b();double a())
 Types: (double)

=for usage

 plscol0a($icolzero, $r, $g, $b, $a); # all arguments given
 $icolzero->plscol0a($r, $g, $b, $a); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscol0a> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscol0a = \&PDL::plscol0a;






=head2 plline

=for sig

 Signature: (x(n); y(n))
 Types: (double)

=for ref

Draws line segments along (x1,y1)->(x2,y2)->(x3,y3)->...

=for bad

If the nth value of either x or y are bad, then it will be skipped, breaking
the line.  In this way, you can specify multiple line segments with a single
pair of x and y ndarrays.

The usage is straight-forward:

=for usage

 plline($x, $y);

For example:

=for example

 # Draw a sine wave
 $x = sequence(100)/10;
 $y = sin($x);

 # Draws the sine wave:
 plline($x, $y);

 # Set values above 3/4 to 'bad', effectively drawing a bunch of detached,
 # capped waves
 $y->setbadif($y > 3/4);
 plline($x, $y);

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plline> processes bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plline = \&PDL::plline;






=head2 plpath

=for sig

 Signature: (int n(); x1(); x2(); y1(); y2())
 Types: (double)

=for usage

 plpath($n, $x1, $x2, $y1, $y2); # all arguments given
 $n->plpath($x1, $x2, $y1, $y2); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plpath> ignores the bad-value flag of the input ndarrays.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plpath = \&PDL::plpath;






=head2 plcolorpoints

=for sig

 Signature: (x(n); y(n); z(n); int sym(); minz(); maxz())
 Types: (double)

=for ref

PDL-specific: Implements what amounts to a threaded version of plsym.

=for bad

Bad values for z are simply skipped; all other bad values are not processed.

In the following usage, all of the ndarrays must have the same dimensions:

=for usage

 plcolorpoints($x, $y, $z, $symbol_index, $minz, $maxz)

For example:

=for example

 # Generate a parabola some points
 my $x = sequence(30) / 3;   # Regular sampling
 my $y = $x**2;              # Parabolic y
 my $z = 30 - $x**3;         # Cubic coloration
 my $symbols = floor($x);    # Use different symbols for each 1/3 of the plot
                             #  These should be integers.

 plcolorpoints($x, $y, $z, $symbols, -5, 20);  # Thread over everything
 plcolorpoints($x, $y, 1, 1, -1, 2);           # same color and symbol for all

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plcolorpoints> processes bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plcolorpoints = \&PDL::plcolorpoints;






=head2 plsmem

=for sig

 Signature: (int maxx();int maxy();image(3,x,y))
 Types: (byte)

=for usage

 plsmem($maxx, $maxy, $image); # all arguments given
 $maxx->plsmem($maxy, $image); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsmem> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsmem = \&PDL::plsmem;






=head2 plfbox

=for sig

 Signature: (xo(); yo())
 Types: (double)

=for usage

 plfbox($xo, $yo); # all arguments given
 $xo->plfbox($yo); # method call

=for ref

Box drawing primitive, taken from PLPLOT bar graph example

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plfbox> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plfbox = \&PDL::plfbox;






=head2 plfbox1

=for sig

 Signature: (xo(); yo(); bh(); w())
 Types: (double)

=for usage

 plfbox1($xo, $yo, $bh, $w); # all arguments given
 $xo->plfbox1($yo, $bh, $w); # method call

=for ref

Box drawing primitive that allows specifying base height and width in addition to offset and height

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plfbox1> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plfbox1 = \&PDL::plfbox1;






=head2 plunfbox

=for sig

 Signature: (xo(); yo())
 Types: (double)

=for usage

 plunfbox($xo, $yo); # all arguments given
 $xo->plunfbox($yo); # method call

=for ref

Similar box drawing primitive, but without fill (just draw outline of box)

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plunfbox> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plunfbox = \&PDL::plunfbox;






=head2 plunfbox1

=for sig

 Signature: (xo(); yo(); bh(); w())
 Types: (double)

=for usage

 plunfbox1($xo, $yo, $bh, $w); # all arguments given
 $xo->plunfbox1($yo, $bh, $w); # method call

=for ref

Box drawing primitive that allows specifying base height and width in addition to offset and height

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plunfbox1> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plunfbox1 = \&PDL::plunfbox1;






=head2 plParseOpts

=for sig

 Signature: (int [o] retval(); SV* argv; int mode)
 Types: (double)

=for usage

 $retval = plParseOpts($argv, $mode);
 plParseOpts($retval, $argv, $mode);  # all arguments given
 $retval = $argv->plParseOpts($mode); # method call
 $retval->plParseOpts($argv, $mode);

=for ref

Parse PLplot options given in @ARGV-like arrays

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plParseOpts> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plParseOpts = \&PDL::plParseOpts;






=head2 plpoin

=for sig

 Signature: (x(n); y(n); int code())
 Types: (double)

=for usage

 plpoin($x, $y, $code); # all arguments given
 $x->plpoin($y, $code); # method call

=for ref

Plots a character at the specified points

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plpoin> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plpoin = \&PDL::plpoin;






=head2 plpoin3

=for sig

 Signature: (x(n); y(n); z(n); int code())
 Types: (double)

=for usage

 plpoin3($x, $y, $z, $code); # all arguments given
 $x->plpoin3($y, $z, $code); # method call

=for ref

Plots a character at the specified points in 3 space

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plpoin3> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plpoin3 = \&PDL::plpoin3;






=head2 plline3

=for sig

 Signature: (x(n); y(n); z(n))
 Types: (double)

=for usage

 plline3($x, $y, $z); # all arguments given
 $x->plline3($y, $z); # method call

=for ref

Draw a line in 3 space

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plline3> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plline3 = \&PDL::plline3;






=head2 plpoly3

=for sig

 Signature: (x(n); y(n); z(n); int draw(m); int ifcc())
 Types: (double)

=for usage

 plpoly3($x, $y, $z, $draw, $ifcc); # all arguments given
 $x->plpoly3($y, $z, $draw, $ifcc); # method call

=for ref

Draws a polygon in 3 space

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plpoly3> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plpoly3 = \&PDL::plpoly3;






=head2 plhist

=for sig

 Signature: (data(n); datmin(); datmax(); int nbin(); int oldwin())
 Types: (double)

=for usage

 plhist($data, $datmin, $datmax, $nbin, $oldwin); # all arguments given
 $data->plhist($datmin, $datmax, $nbin, $oldwin); # method call

=for ref

Plot a histogram from unbinned data

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plhist> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plhist = \&PDL::plhist;






=head2 plfill

=for sig

 Signature: (x(n); y(n))
 Types: (double)

=for usage

 plfill($x, $y); # all arguments given
 $x->plfill($y); # method call

=for ref

Area fill

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plfill> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plfill = \&PDL::plfill;






=head2 plgradient

=for sig

 Signature: (x(n); y(n); angle())
 Types: (double)

=for usage

 plgradient($x, $y, $angle); # all arguments given
 $x->plgradient($y, $angle); # method call

=for ref

Area fill with color gradient

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgradient> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgradient = \&PDL::plgradient;






=head2 plsym

=for sig

 Signature: (x(n); y(n); int code())
 Types: (double)

=for usage

 plsym($x, $y, $code); # all arguments given
 $x->plsym($y, $code); # method call

=for ref

Plots a symbol at the specified points

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsym> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsym = \&PDL::plsym;






=head2 plsurf3d

=for sig

 Signature: (x(nx); y(ny); z(nx,ny); int opt(); clevel(nlevel))
 Types: (double)

=for usage

 plsurf3d($x, $y, $z, $opt, $clevel); # all arguments given
 $x->plsurf3d($y, $z, $opt, $clevel); # method call

=for ref

Plot shaded 3-d surface plot

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsurf3d> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsurf3d = \&PDL::plsurf3d;






=head2 plsurf3dl

=for sig

 Signature: (x(nx); y(ny); z(nx,ny); int opt(); clevel(nlevel); int indexxmin(); int indexxmax(); int indexymin(nx); int indexymax(nx))
 Types: (double)

=for usage

 plsurf3dl($x, $y, $z, $opt, $clevel, $indexxmin, $indexxmax, $indexymin, $indexymax); # all arguments given
 $x->plsurf3dl($y, $z, $opt, $clevel, $indexxmin, $indexxmax, $indexymin, $indexymax); # method call

=for ref

Plot shaded 3-d surface plot with limits

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsurf3dl> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsurf3dl = \&PDL::plsurf3dl;






=head2 plstyl

=for sig

 Signature: (int mark(nms); int space(nms))
 Types: (double)

=for usage

 plstyl($mark, $space); # all arguments given
 $mark->plstyl($space); # method call

=for ref

Set line style

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plstyl> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plstyl = \&PDL::plstyl;






=head2 plseed

=for sig

 Signature: (int seed())
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 plseed($seed); # all arguments given
 $seed->plseed; # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plseed> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plseed = \&PDL::plseed;






=head2 plrandd

=for sig

 Signature: (double [o]rand())
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 $rand = plrandd();
 plrandd($rand);    # all arguments given
 $rand->plrandd;

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plrandd> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plrandd = \&PDL::plrandd;






=head2 plAllocGrid

=for sig

 Signature: (double xg(nx); double yg(ny); [o] PLcGridPtr__OUT grid)
 Types: (double)

=for usage

 $grid = plAllocGrid($xg, $yg);
 plAllocGrid($xg, $yg, $grid);  # all arguments given
 $grid = $xg->plAllocGrid($yg); # method call
 $xg->plAllocGrid($yg, $grid);

=for ref

Allocates a PLcGrid object for use in pltr1

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plAllocGrid> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plAllocGrid = \&PDL::plAllocGrid;






=head2 plAlloc2dGrid

=for sig

 Signature: (double xg(nx,ny); double yg(nx,ny); [o] PLcGrid2Ptr__OUT grid)
 Types: (double)

=for usage

 $grid = plAlloc2dGrid($xg, $yg);
 plAlloc2dGrid($xg, $yg, $grid);  # all arguments given
 $grid = $xg->plAlloc2dGrid($yg); # method call
 $xg->plAlloc2dGrid($yg, $grid);

=for ref

Allocates a PLcGrid2 object for use in pltr2

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plAlloc2dGrid> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plAlloc2dGrid = \&PDL::plAlloc2dGrid;






=head2 init_pltr

=for sig

 Signature: (; SV* p0; SV* p1; SV* p2)
 Types: (double)

=for usage

 init_pltr($p0, $p1, $p2); # all arguments given
 $p0->init_pltr($p1, $p2); # method call

Used internally to set the variables C<pltr{0,1,2}_iv> to the "pointers"
of the Perl subroutines C<pltr{1,2,3}>.  These variables are later used by
C<get_standard_pltrcb> to provide the pointers to the C function C<pltr{0,1,2}>.
This accelerates functions like plcont and plshades when those standard
transformation functions are used.

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<init_pltr> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*init_pltr = \&PDL::init_pltr;





#line 3986 "plplot.pd"

init_pltr (\&pltr0, \&pltr1, \&pltr2);
#line 6636 "PLplot.pm"


=head2 plmap

=for sig

 Signature: (minlong(); maxlong(); minlat(); maxlat(); SV* mapform; char* type)
 Types: (double)

=for usage

 plmap($minlong, $maxlong, $minlat, $maxlat, $mapform, $type); # all arguments given
 $minlong->plmap($maxlong, $minlat, $maxlat, $mapform, $type); # method call

=for ref

plot continental outline in world coordinates

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plmap> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




sub PDL::plmap { _reorder('plmap', 'PDL::_plmap_int', $standard_order, @_) }



*plmap = \&PDL::plmap;






=head2 plstring

=for sig

 Signature: (x(na); y(na); char* string)
 Types: (double)

=for usage

 plstring($x, $y, $string); # all arguments given
 $x->plstring($y, $string); # method call

=for ref

plot a string along a line

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plstring> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plstring = \&PDL::plstring;






=head2 plstring3

=for sig

 Signature: (x(na); y(na); z(na); char* string)
 Types: (double)

=for usage

 plstring3($x, $y, $z, $string); # all arguments given
 $x->plstring3($y, $z, $string); # method call

=for ref

plot a string along a 3D line

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plstring3> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plstring3 = \&PDL::plstring3;






=head2 plmeridians

=for sig

 Signature: (dlong(); dlat(); minlong(); maxlong(); minlat(); maxlat(); SV* mapform)
 Types: (double)

=for usage

 plmeridians($dlong, $dlat, $minlong, $maxlong, $minlat, $maxlat, $mapform); # all arguments given
 $dlong->plmeridians($dlat, $minlong, $maxlong, $minlat, $maxlat, $mapform); # method call

=for ref

Plot the latitudes and longitudes on the background

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plmeridians> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




sub PDL::plmeridians { _reorder('plmeridians', 'PDL::_plmeridians_int', $standard_order, @_) }



*plmeridians = \&PDL::plmeridians;






=head2 plshades

=for sig

 Signature: (z(x,y); xmin(); xmax(); ymin(); ymax();
                  clevel(l); int fill_width(); int cont_color();
                  int cont_width(); int rectangular(); SV* defined; SV* pltr; SV* pltr_data)
 Types: (double)

=for usage

 plshades($z, $xmin, $xmax, $ymin, $ymax, $clevel, $fill_width, $cont_color, $cont_width, $rectangular, $defined, $pltr, $pltr_data); # all arguments given
 $z->plshades($xmin, $xmax, $ymin, $ymax, $clevel, $fill_width, $cont_color, $cont_width, $rectangular, $defined, $pltr, $pltr_data); # method call

=for ref

Shade regions on the basis of value

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plshades> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




sub PDL::plshades { _reorder('plshades', 'PDL::_plshades_int', $standard_order, @_) }



*plshades = \&PDL::plshades;






=head2 plcont

=for sig

 Signature: (f(nx,ny); int kx(); int lx(); int ky(); int ly(); clevel(nlevel); SV* pltr; SV* pltr_data)
 Types: (double)

=for usage

 plcont($f, $kx, $lx, $ky, $ly, $clevel, $pltr, $pltr_data); # all arguments given
 $f->plcont($kx, $lx, $ky, $ly, $clevel, $pltr, $pltr_data); # method call

=for ref

Plot contours

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plcont> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plcont = \&PDL::plcont;






=head2 plmesh

=for sig

 Signature: (x(nx); y(ny); z(nx,ny); int opt())
 Types: (double)

=for usage

 plmesh($x, $y, $z, $opt); # all arguments given
 $x->plmesh($y, $z, $opt); # method call

=for ref

Surface mesh

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plmesh> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plmesh = \&PDL::plmesh;






=head2 plmeshc

=for sig

 Signature: (x(nx); y(ny); z(nx,ny); int opt(); clevel(nlevel))
 Types: (double)

=for usage

 plmeshc($x, $y, $z, $opt, $clevel); # all arguments given
 $x->plmeshc($y, $z, $opt, $clevel); # method call

=for ref

Magnitude colored plot surface mesh with contour

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plmeshc> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plmeshc = \&PDL::plmeshc;






=head2 plot3d

=for sig

 Signature: (x(nx); y(ny); z(nx,ny); int opt(); int side())
 Types: (double)

=for usage

 plot3d($x, $y, $z, $opt, $side); # all arguments given
 $x->plot3d($y, $z, $opt, $side); # method call

=for ref

3-d surface plot

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plot3d> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plot3d = \&PDL::plot3d;






=head2 plot3dc

=for sig

 Signature: (x(nx); y(ny); z(nx,ny); int opt(); clevel(nlevel))
 Types: (double)

=for usage

 plot3dc($x, $y, $z, $opt, $clevel); # all arguments given
 $x->plot3dc($y, $z, $opt, $clevel); # method call

=for ref

Plots a 3-d representation of the function z[x][y] with contour

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plot3dc> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plot3dc = \&PDL::plot3dc;






=head2 plscmap1l

=for sig

 Signature: (int itype(); isty(n); coord1(n); coord2(n); coord3(n); int rev(nrev))
 Types: (double)

=for usage

 plscmap1l($itype, $isty, $coord1, $coord2, $coord3, $rev); # all arguments given
 $itype->plscmap1l($isty, $coord1, $coord2, $coord3, $rev); # method call

=for ref

Set color map1 colors using a piece-wise linear relationship

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscmap1l> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscmap1l = \&PDL::plscmap1l;






=head2 plshade1

=for sig

 Signature: (a(nx,ny); left(); right(); bottom(); top(); shade_min();shade_max(); sh_cmap(); sh_color(); sh_width();min_color(); min_width(); max_color(); max_width();rectangular(); SV* defined; SV* pltr; SV* pltr_data)
 Types: (double)

=for usage

 plshade1($a, $left, $right, $bottom, $top, $shade_min, $shade_max, $sh_cmap, $sh_color, $sh_width, $min_color, $min_width, $max_color, $max_width, $rectangular, $defined, $pltr, $pltr_data); # all arguments given
 $a->plshade1($left, $right, $bottom, $top, $shade_min, $shade_max, $sh_cmap, $sh_color, $sh_width, $min_color, $min_width, $max_color, $max_width, $rectangular, $defined, $pltr, $pltr_data); # method call

=for ref

Shade individual region on the basis of value

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plshade1> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




sub PDL::plshade1 { _reorder('plshade1', 'PDL::_plshade1_int', $standard_order, @_) }



*plshade1 = \&PDL::plshade1;






=head2 plimage

=for sig

 Signature: (idata(nx,ny); xmin(); xmax(); ymin(); ymax();zmin(); zmax(); Dxmin(); Dxmax(); Dymin(); Dymax())
 Types: (double)

=for usage

 plimage($idata, $xmin, $xmax, $ymin, $ymax, $zmin, $zmax, $Dxmin, $Dxmax, $Dymin, $Dymax); # all arguments given
 $idata->plimage($xmin, $xmax, $ymin, $ymax, $zmin, $zmax, $Dxmin, $Dxmax, $Dymin, $Dymax); # method call

=for ref

Plot gray-level image

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plimage> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plimage = \&PDL::plimage;






=head2 plimagefr

=for sig

 Signature: (idata(nx,ny); xmin(); xmax(); ymin(); ymax();zmin(); zmax(); valuemin(); valuemax(); SV* pltr; SV* pltr_data)
 Types: (double)

=for usage

 plimagefr($idata, $xmin, $xmax, $ymin, $ymax, $zmin, $zmax, $valuemin, $valuemax, $pltr, $pltr_data); # all arguments given
 $idata->plimagefr($xmin, $xmax, $ymin, $ymax, $zmin, $zmax, $valuemin, $valuemax, $pltr, $pltr_data); # method call

=for ref

Plot image with transformation

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plimagefr> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plimagefr = \&PDL::plimagefr;





#line 4242 "plplot.pd"

=head2 plxormod

=for sig

  $status = plxormod ($mode)

=for ref

Set xor mode:
mode = 1-enter, 0-leave, status = 0 if not interactive device

See the PLplot manual for reference.

=cut

#line 4273 "plplot.pd"

=head2 plGetCursor

=for sig

  %gin = plGetCursor ()

=for ref

plGetCursor waits for graphics input event and translate to world
coordinates and returns a hash with the following keys:

    type:      of event (CURRENTLY UNUSED)
    state:     key or button mask
    keysym:    key selected
    button:    mouse button selected
    subwindow: subwindow (alias subpage, alias subplot) number
    string:    translated string
    pX, pY:    absolute device coordinates of pointer
    dX, dY:    relative device coordinates of pointer
    wX, wY:    world coordinates of pointer

Returns an empty hash if no translation to world coordinates is possible.

=cut

#line 4336 "plplot.pd"

=head2 plgstrm

=for sig

  $strm = plgstrm ()

=for ref

Returns the number of the current output stream.

=cut

#line 4363 "plplot.pd"

=head2 plgsdev

=for sig

  $driver = plgdev ()

=for ref

Returns the current driver name.

=cut

#line 4403 "plplot.pd"

=head2 plmkstrm

=for sig

  $strm = plmkstrm ()

=for ref

Creates a new stream and makes it the default.  Returns the number of
the created stream.

=cut

#line 4431 "plplot.pd"

=head2 plgver

=for sig

  $version = plgver ()

=for ref

Get the current library version number

See the PLplot manual for reference.

=cut
#line 7290 "PLplot.pm"


=head2 plstripc

=for sig

 Signature: (xmin(); xmax(); xjump(); ymin(); ymax();xlpos(); ylpos(); int y_ascl(); int acc();int colbox(); int collab();int colline(n); int styline(n);int [o] id(); char* xspec; char* yspec; SV* legline;char* labx; char* laby; char* labtop)
 Types: (double)

=for usage

 $id = plstripc($xmin, $xmax, $xjump, $ymin, $ymax, $xlpos, $ylpos, $y_ascl, $acc, $colbox, $collab, $colline, $styline, $xspec, $yspec, $legline, $labx, $laby, $labtop);
 plstripc($xmin, $xmax, $xjump, $ymin, $ymax, $xlpos, $ylpos, $y_ascl, $acc, $colbox, $collab, $colline, $styline, $id, $xspec, $yspec, $legline, $labx, $laby, $labtop);  # all arguments given
 $id = $xmin->plstripc($xmax, $xjump, $ymin, $ymax, $xlpos, $ylpos, $y_ascl, $acc, $colbox, $collab, $colline, $styline, $xspec, $yspec, $legline, $labx, $laby, $labtop); # method call
 $xmin->plstripc($xmax, $xjump, $ymin, $ymax, $xlpos, $ylpos, $y_ascl, $acc, $colbox, $collab, $colline, $styline, $id, $xspec, $yspec, $legline, $labx, $laby, $labtop);

=for ref

FIXME: documentation here!

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plstripc> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




sub PDL::plstripc { _reorder('plstripc', 'PDL::_plstripc_int', $standard_order, @_) }



*plstripc = \&PDL::plstripc;






=head2 plgriddata

=for sig

 Signature: (x(npts); y(npts); z(npts); xg(nptsx); yg(nptsy);int type(); data(); [o] zg(nptsx,nptsy))
 Types: (double)

=for usage

 $zg = plgriddata($x, $y, $z, $xg, $yg, $type, $data);
 plgriddata($x, $y, $z, $xg, $yg, $type, $data, $zg);  # all arguments given
 $zg = $x->plgriddata($y, $z, $xg, $yg, $type, $data); # method call
 $x->plgriddata($y, $z, $xg, $yg, $type, $data, $zg);

=for ref

FIXME: documentation here!

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgriddata> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgriddata = \&PDL::plgriddata;





#line 4522 "plplot.pd"

=head2 plarc

=for sig

  plarc ($x, $y, $a, $b, $angle1, $angle2, $rotate, $fill);

=for ref

Draw a (possibly) filled arc centered at x, y with semimajor axis a and semiminor axis b, starting at angle1 and ending at angle2.
See the PLplot manual for reference.

=cut

#line 4554 "plplot.pd"

=head2 plstransform

=for sig

  plstransform ($subroutine_reference, $data);

=for ref

Sets the default transformation routine for plotting.

  sub mapform {
    my ($x, $y, $data) = @_;

    my $radius = 90.0 - $y;
    my $xp = $radius * cos ($x * pi / 180);
    my $yp = $radius * sin ($x * pi / 180);

    return ($xp, $yp);
  }
  plstransform (\&mapform, undef);

See the PLplot manual for more details.

=cut

#line 4595 "plplot.pd"

=head2 plslabelfunc

=for sig

  plslabelfunc ($subroutine_reference);

=for ref

  # A custom axis labeling function for longitudes and latitudes.
  sub geolocation_labeler {
    my ($axis, $value, $length) = @_;
    my ($direction_label, $label_val);
    if (($axis == PL_Y_AXIS) && $value == 0) {
        return "Eq";
      } elsif ($axis == PL_Y_AXIS) {
      $label_val = $value;
      $direction_label = ($label_val > 0) ? " N" : " S";
    } elsif ($axis == PL_X_AXIS) {
      my $times  = floor((abs($value) + 180.0 ) / 360.0);
      $label_val = ($value < 0) ? $value + 360.0 * $times : $value - 360.0 * $times;
      $direction_label = ($label_val > 0) ? " E"
                       : ($label_val < 0) ? " W"
                       :                    "";
    }
    return substr (sprintf ("%.0f%s", abs($label_val), $direction_label), 0, $length);
  }
  plslabelfunc(\&geolocation_labeler);

The PDL version of plslabelfunc only has one argument--the perl subroutine
to do the label translation:

  my $labeltext = perl_labelfunc($axis, $value, $length);

No 'data' argument is used, it is assumed that global data or a closure containing
necessary data can be used in 'perl_labelfunc'.

See the PLplot manual for more details.

=cut

#line 4650 "plplot.pd"

=head2 pllegend

=for sig

  my ($legend_width, $legend_height) =
      pllegend ($position, $opt, $x, $y, $plot_width, $bg_color, $nlegend,
      \@opt_array,
      $text_offset, $text_scale, $text_spacing, $test_justification,
      \@text_colors, \@text, \@box_colors, \@box_patterns, \@box_scales, \@line_colors,
      \@line_styles, \@line_widths, \@symbol_colors, \@symbol_scales, \@symbol_numbers, \@symbols);

=for ref

See the PLplot manual for more details.

=cut

#line 4828 "plplot.pd"

=head2 plspal0

=for sig

  plspal0($filename);

=for ref

Set color palette 0 from the input .pal file.  See the PLplot manual for more details.

=cut

#line 4853 "plplot.pd"

=head2 plspal1

=for sig

  plspal1($filename);

=for ref

Set color palette 1 from the input .pal file.  See the PLplot manual for more details.

=cut

#line 4877 "plplot.pd"

=head2 plbtime

=for sig

  my ($year, $month, $day, $hour, $min, $sec) = plbtime($ctime);

=for ref

Calculate broken-down time from continuous time for current stream.

=cut

#line 4913 "plplot.pd"

=head2 plconfigtime

=for sig

  plconfigtime($scale, $offset1, $offset2, $ccontrol, $ifbtime_offset, $year, $month, $day, $hour, $min, $sec);

=for ref

Configure transformation between continuous and broken-down time (and
vice versa) for current stream.

=cut

#line 4949 "plplot.pd"

=head2 plctime

=for sig

  my $ctime = plctime($year, $month, $day, $hour, $min, $sec);

=for ref

Calculate continuous time from broken-down time for current stream.

=cut

#line 4980 "plplot.pd"

=head2 pltimefmt

=for sig

  pltimefmt($fmt);

=for ref

Set format for date / time labels. Labels must be configured to treat values as
seconds since the epoch via the XBOX/YBOX flags. C<$fmt> is generally
consistent with the POSIX strpformat/strftime flags, but see the PLplot manual
for details.

=cut

#line 5006 "plplot.pd"

=head2 plsesc

=for sig

  plsesc($esc);

=for ref

Set the escape character for text strings.  See the PLplot manual for more details.

=cut
#line 7580 "PLplot.pm"


=head2 plvect

=for sig

 Signature: (u(nx,ny); v(nx,ny); scale(); SV* pltr; SV* pltr_data)
 Types: (double)

=for usage

 plvect($u, $v, $scale, $pltr, $pltr_data); # all arguments given
 $u->plvect($v, $scale, $pltr, $pltr_data); # method call

=for ref

Vector field plots

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plvect> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plvect = \&PDL::plvect;






=head2 plsvect

=for sig

 Signature: (arrowx(npts); arrowy(npts); int fill())
 Types: (double)

=for usage

 plsvect($arrowx, $arrowy, $fill); # all arguments given
 $arrowx->plsvect($arrowy, $fill); # method call

=for ref

Give zero-length PDLs for arrowx and arrowy to pass NULL to PLplot func.

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsvect> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsvect = \&PDL::plsvect;






=head2 plhlsrgb

=for sig

 Signature: (double h();double l();double s();double [o]p_r();double [o]p_g();double [o]p_b())
 Types: (double)

=for usage

 ($p_r, $p_g, $p_b) = plhlsrgb($h, $l, $s);
 plhlsrgb($h, $l, $s, $p_r, $p_g, $p_b);    # all arguments given
 ($p_r, $p_g, $p_b) = $h->plhlsrgb($l, $s); # method call
 $h->plhlsrgb($l, $s, $p_r, $p_g, $p_b);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plhlsrgb> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plhlsrgb = \&PDL::plhlsrgb;






=head2 plgcol0

=for sig

 Signature: (int icolzero(); int [o]r(); int [o]g(); int [o]b())
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 ($r, $g, $b) = plgcol0($icolzero);
 plgcol0($icolzero, $r, $g, $b);    # all arguments given
 ($r, $g, $b) = $icolzero->plgcol0; # method call
 $icolzero->plgcol0($r, $g, $b);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgcol0> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgcol0 = \&PDL::plgcol0;






=head2 plgcolbg

=for sig

 Signature: (int [o]r(); int [o]g(); int [o]b())
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 ($r, $g, $b) = plgcolbg();
 plgcolbg($r, $g, $b);      # all arguments given
 $r->plgcolbg($g, $b);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgcolbg> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgcolbg = \&PDL::plgcolbg;






=head2 plscmap0

=for sig

 Signature: (int r(n); int g(n); int b(n))
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 plscmap0($r, $g, $b); # all arguments given
 $r->plscmap0($g, $b); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscmap0> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscmap0 = \&PDL::plscmap0;






=head2 plscmap1

=for sig

 Signature: (int r(n); int g(n); int b(n))
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 plscmap1($r, $g, $b); # all arguments given
 $r->plscmap1($g, $b); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscmap1> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscmap1 = \&PDL::plscmap1;






=head2 plgcol0a

=for sig

 Signature: (int icolzero(); int [o]r(); int [o]g(); int [o]b(); double [o]a())
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 ($r, $g, $b, $a) = plgcol0a($icolzero);
 plgcol0a($icolzero, $r, $g, $b, $a);    # all arguments given
 ($r, $g, $b, $a) = $icolzero->plgcol0a; # method call
 $icolzero->plgcol0a($r, $g, $b, $a);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgcol0a> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgcol0a = \&PDL::plgcol0a;






=head2 plgcolbga

=for sig

 Signature: (int [o]r(); int [o]g(); int [o]b(); double [o]a())
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 ($r, $g, $b, $a) = plgcolbga();
 plgcolbga($r, $g, $b, $a);      # all arguments given
 $r->plgcolbga($g, $b, $a);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgcolbga> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgcolbga = \&PDL::plgcolbga;






=head2 plscmap0a

=for sig

 Signature: (int r(n); int g(n); int b(n); double a(n))
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 plscmap0a($r, $g, $b, $a); # all arguments given
 $r->plscmap0a($g, $b, $a); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscmap0a> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscmap0a = \&PDL::plscmap0a;






=head2 plscmap1a

=for sig

 Signature: (int r(n); int g(n); int b(n); double a(n))
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 plscmap1a($r, $g, $b, $a); # all arguments given
 $r->plscmap1a($g, $b, $a); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscmap1a> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscmap1a = \&PDL::plscmap1a;






=head2 plscmap1la

=for sig

 Signature: (int itype(); isty(n); coord1(n); coord2(n); coord3(n); coord4(n); int rev(nrev))
 Types: (double)

=for usage

 plscmap1la($itype, $isty, $coord1, $coord2, $coord3, $coord4, $rev); # all arguments given
 $itype->plscmap1la($isty, $coord1, $coord2, $coord3, $coord4, $rev); # method call

=for ref

Set color map1 colors using a piece-wise linear relationship, include alpha channel

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plscmap1la> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plscmap1la = \&PDL::plscmap1la;






=head2 plgfont

=for sig

 Signature: (int [o]p_family(); int [o]p_style(); int [o]p_weight())
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 ($p_family, $p_style, $p_weight) = plgfont();
 plgfont($p_family, $p_style, $p_weight);      # all arguments given
 $p_family->plgfont($p_style, $p_weight);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plgfont> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plgfont = \&PDL::plgfont;






=head2 plsfont

=for sig

 Signature: (int family(); int style(); int weight())
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 plsfont($family, $style, $weight); # all arguments given
 $family->plsfont($style, $weight); # method call

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plsfont> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plsfont = \&PDL::plsfont;






=head2 plcalc_world

=for sig

 Signature: (double rx(); double ry(); double [o]wx(); double [o]wy(); int [o]window())
 Types: (sbyte byte short ushort long ulong indx ulonglong longlong
   float double ldouble)

=for usage

 ($wx, $wy, $window) = plcalc_world($rx, $ry);
 plcalc_world($rx, $ry, $wx, $wy, $window);    # all arguments given
 ($wx, $wy, $window) = $rx->plcalc_world($ry); # method call
 $rx->plcalc_world($ry, $wx, $wy, $window);

=for ref

info not available

=pod

Broadcasts over its inputs.
Can't use POSIX threads.

=for bad

C<plcalc_world> does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.

=cut




*plcalc_world = \&PDL::plcalc_world;





#line 5202 "plplot.pd"

=head2 pl_cmd

=for sig

   pl_cmd($CMD, $data);

=for ref

   See the PLplot manual for reference.
   Gives access to low level driver. $CMD is an integer. $data opaque data.

=cut

#line 5227 "plplot.pd"

=head2 pl_setCairoCtx

=for sig

   pl_setCairoCtx($cairo_context);

=for ref

   Used with cairo external drivers to set the cairo context.
   $cairo_context should be a Cairo::Context object.
   Uses pl_cmd underneath, but extracts the real C struct pointer from the Cairo::Context.

=cut

#line 5253 "plplot.pd"

=pod

=head1 WARNINGS AND ERRORS

PLplot gives many errors and warnings.  Some of these are given by the
PDL interface while others are internal PLplot messages.  Below are
some of these messages, and what you need to do to address them:

=over

=item *
Box must be a ref to a four element array

When specifying a box, you must pass a reference to a
four-element array, or use an anonymous four-element array.

 # Gives trouble:
 $pl->xyplot($x, $y, BOX => (0, 0, 100, 200) );
 # What you meant to say was:
 $pl->xyplot($x, $y, BOX => [0, 0, 100, 200] );

=item *
Too many colors used! (max 15)

=back

=head1 AUTHORS

  Doug Hunt <dhunt@ucar.edu>
  Rafael Laboissiere <rlaboiss@users.sourceforge.net>
  David Mertens <mertens2@illinois.edu>

=head1 SEE ALSO

perl(1), PDL(1), L<http://www.plplot.org/>

The other common graphics packages include L<PDL::Graphics::PGPLOT>,
L<PDL::Graphics::Simple> and L<PDL::Graphics::TriD>.

=cut
#line 8247 "PLplot.pm"

# Exit with OK status

1;
