NAME
PDL::Graphics::PLplot - Object-oriented interface from perl/PDL to the PLPLOT plotting library
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, t/plplot.t in this distribution for some working examples.
LONG NAMES
If you are annoyed by the long constructor call, consider installing the aliased CPAN package. Using 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
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.
OPTIONS
The following options are supported. Most options can be used with any function. A few are only supported on the call to 'new'.
Options used upon creation of a PLplot object (with 'new'):
BACKGROUND
Set the color for index 0, the plot background
DEV
Set the output device type. To see a list of allowed types, try:
PDL::Graphics::PLplot->new();
PDL::Graphics::PLplot->new(DEV => 'png', FILE => 'test.png');
FILE
Set the output file or display. For file output devices, sets the output file name. For graphical displays (like 'xwin') sets the name of the display, eg ('hostname.foobar.com:0')
PDL::Graphics::PLplot->new(DEV => 'png', FILE => 'test.png');
PDL::Graphics::PLplot->new(DEV => 'xwin', FILE => ':0');
OPTS
Set plotting options. See the PLplot documentation for the complete listing of available options. The value of '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:
PDL::Graphics::PLplot->new(DEV => 'ps', OPTS => {drvopt => 'text=1'});
MEM
This option is used in conjunction with 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, PDL::IO::Pic. This option may not be available if plplot does not include the 'mem' driver.
# 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;
FRAMECOLOR
Set color index 1, the frame color
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.
PDL::Graphics::PLplot->new(DEV => 'png', FILE => 'test.png', JUST => 1);
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.
# portrait orientation
PDL::Graphics::PLplot->new(DEV => 'png', FILE => 'test.png', ORIENTATION => 1);
PAGESIZE
Set the size in pixels of the output page.
# PNG 500 by 600 pixels
PDL::Graphics::PLplot->new(DEV => 'png', FILE => 'test.png', PAGESIZE => [500,600]);
SUBPAGES
Set the number of sub pages in the plot, [$nx, $ny]
# 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]);
Options used after initialization (after 'new')
BOX
Set the plotting box in world coordinates. Used to explicitly set the size of the plotting area.
my $pl = PDL::Graphics::PLplot->new(DEV => 'png', FILE => 'test.png');
$pl->xyplot ($x, $y, BOX => [0,100,0,200]);
CHARSIZE
Set the size of text in multiples of the default size. CHARSIZE => 1.5 gives characters 1.5 times the normal size.
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
# These two are equivalent:
$pl->xyplot ($x, $y, COLOR => 'YELLOW');
$pl->xyplot ($x, $y, COLOR => [0,255,0]);
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";
$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
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.
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]);
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.
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]);
LINEWIDTH
Set the line width for plotting. Values range from 1 to a device dependent maximum.
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.
MAJTICKSIZE
Set the length of major ticks as a fraction of the default setting. One (default) means leave these ticks the normal size.
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.
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.
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.
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
# Plot x/y points with the z axis in color
$pl->xyplot ($x, $y, PALETTE => 'RAINBOW', PLOTTYPE => 'POINTS', COLORMAP => $z);
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
STACKED_BAR_COLORS
For 'bargraph', request a stacked bar chart. Must contain a reference to a perl list of color names or RGB triples.
# $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]);
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 pladv()).
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);
SYMBOL
Specify which symbol to use when plotting 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
SYMBOLSIZE
Specify the size of symbols plotted in multiples of the default size (1). Value are real numbers from 0 to large.
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.
# 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]);
TITLE
Add a title on top of a plot.
# Plot text on top of plot
$pl->xyplot ($x, $y, TITLE => 'X vs. Y');
UNFILLED_BARS
For 'bargraph', if set to true then plot the bars as outlines in the current color and not as filled boxes
# Plot text on top of plot
$pl->bargraph($labels, $values, UNFILLED_BARS => 1);
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.
# 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]);
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 'BCNST' which draws lines around the plot, draws major and minor ticks and labels major ticks.
# 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]);
XERRORBAR
Used only with "xyplot". Draws horizontal error bars at all points ($x, $y) in the plot. Specify a PDL containing the same number of points as $x and $y which specifies the width of the error bar, which will be centered at ($x, $y).
XLAB
Specify a label for the X axis.
XTICK
Interval (in graph units/world coordinates) between major x axis tick marks. Specify zero (default) to allow PLplot to compute this automatically.
YBOX
Specify how to label the Y axis of the plot as a string of option letters. See "XBOX".
YERRORBAR
Used only for xyplot. Draws vertical error bars at all points ($x, $y) in the plot. Specify a PDL containing the same number of points as $x and $y which specifies the width of the error bar, which will be centered at ($x, $y).
YLAB
Specify a label for the Y axis.
YTICK
Interval (in graph units/world coordinates) between major y axis tick marks. Specify zero (default) to allow PLplot to compute this automatically.
ZRANGE
For "xyplot" (when COLORMAP is specified), for "shadeplot" and for "colorkey". Normally, the range of the Z variable (color) is taken as $z->minmax. If a different range is desired, specify it in 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]);
METHODS
These are the high-level, object oriented methods for PLplot.
new
Create an object representing a plot.
Arguments:
none.
Supported options:
BACKGROUND
DEV
FILE
FRAMECOLOR
JUST
PAGESIZE
SUBPAGES
my $pl = PDL::Graphics::PLplot->new(DEV => 'png', FILE => 'test.png');
setparm
Set options for a plot object.
Arguments:
none.
Supported options:
All options except:
BACKGROUND
DEV
FILE
FRAMECOLOR
JUST
PAGESIZE
SUBPAGES
(These must be set in call to 'new'.)
$pl->setparm (TEXTSIZE => 2);
xyplot
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 $x and $y can be the continent boundary latitude and longitude.
Arguments:
$x, $y
Supported options:
All options except:
BACKGROUND
DEV
FILE
FRAMECOLOR
JUST
PAGESIZE
SUBPAGES
(These must be set in call to 'new'.)
$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);
stripplots
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.
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'.)
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).
colorkey
Plot a color key showing which color represents which value
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'.)
# 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]);
shadeplot
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 "BOX" option.
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'.)
# 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]);
histogram
Create a histogram of a 1-D variable.
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'.)
$pl->histogram ($x, $nbins, BOX => [$min, $max, 0, 100]);
histogram1
Create a histogram of a 1-D variable. This alternative to 'histogram' creates filled boxes and also handles Y-axis scaling better.
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'.)
$pl->histogram1 ($x, $nbins, COLOR => 'GREEN');
bargraph
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.
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'.)
$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]])
text
Write text on a plot. Text can either be written with respect to the borders or at an arbitrary location and angle (see the "TEXTPOSITION" entry).
Arguments:
$t : The text.
Supported options:
All options except:
BACKGROUND
DEV
FILE
FRAMECOLOR
JUST
PAGESIZE
SUBPAGES
(These must be set in call to 'new'.)
$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
close
Close a PLplot object, writing out the file and cleaning up.
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.
$pl->close;
FUNCTIONS
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 (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 (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.
pladv
Signature: (int page())
Types: (double)
pladv($page); # all arguments given
$page->pladv; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plaxes
Signature: (double xzero();double yzero();double xtick();int nxsub();double ytick();int nysub(); char *xopt;char *yopt)
Types: (double)
plaxes($xzero, $yzero, $xtick, $nxsub, $ytick, $nysub, $xopt, $yopt); # all arguments given
$xzero->plaxes($yzero, $xtick, $nxsub, $ytick, $nysub, $xopt, $yopt); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plbin
Signature: (int nbin();double x(dima);double y(dima);int center())
Types: (double)
plbin($nbin, $x, $y, $center); # all arguments given
$nbin->plbin($x, $y, $center); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plbox
Signature: (double xtick();int nxsub();double ytick();int nysub(); char *xopt;char *yopt)
Types: (double)
plbox($xtick, $nxsub, $ytick, $nysub, $xopt, $yopt); # all arguments given
$xtick->plbox($nxsub, $ytick, $nysub, $xopt, $yopt); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plbox3
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)
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
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plcol0
Signature: (int icolzero())
Types: (double)
plcol0($icolzero); # all arguments given
$icolzero->plcol0; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plcol1
Signature: (double colone())
Types: (double)
plcol1($colone); # all arguments given
$colone->plcol1; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plcpstrm
Signature: (int iplsr();int flags())
Types: (double)
plcpstrm($iplsr, $flags); # all arguments given
$iplsr->plcpstrm($flags); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
pldid2pc
Signature: (double xmin(dima);double ymin(dima);double xmax(dima);double ymax(dima))
Types: (double)
pldid2pc($xmin, $ymin, $xmax, $ymax); # all arguments given
$xmin->pldid2pc($ymin, $xmax, $ymax); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
pldip2dc
Signature: (double xmin(dima);double ymin(dima);double xmax(dima);double ymax(dima))
Types: (double)
pldip2dc($xmin, $ymin, $xmax, $ymax); # all arguments given
$xmin->pldip2dc($ymin, $xmax, $ymax); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plenv
Signature: (double xmin();double xmax();double ymin();double ymax();int just();int axis())
Types: (double)
plenv($xmin, $xmax, $ymin, $ymax, $just, $axis); # all arguments given
$xmin->plenv($xmax, $ymin, $ymax, $just, $axis); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plenv0
Signature: (double xmin();double xmax();double ymin();double ymax();int just();int axis())
Types: (double)
plenv0($xmin, $xmax, $ymin, $ymax, $just, $axis); # all arguments given
$xmin->plenv0($xmax, $ymin, $ymax, $just, $axis); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plerrx
Signature: (int n();double xmin(dima);double xmax(dima);double y(dima))
Types: (double)
plerrx($n, $xmin, $xmax, $y); # all arguments given
$n->plerrx($xmin, $xmax, $y); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plerry
Signature: (int n();double x(dima);double ymin(dima);double ymax(dima))
Types: (double)
plerry($n, $x, $ymin, $ymax); # all arguments given
$n->plerry($x, $ymin, $ymax); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plfill3
Signature: (int n();double x(dima);double y(dima);double z(dima))
Types: (double)
plfill3($n, $x, $y, $z); # all arguments given
$n->plfill3($x, $y, $z); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plfont
Signature: (int ifont())
Types: (double)
plfont($ifont); # all arguments given
$ifont->plfont; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plfontld
Signature: (int fnt())
Types: (double)
plfontld($fnt); # all arguments given
$fnt->plfontld; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgchr
Signature: (double [o]p_def();double [o]p_ht())
Types: (double)
($p_def, $p_ht) = plgchr();
plgchr($p_def, $p_ht); # all arguments given
$p_def->plgchr($p_ht);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgcompression
Signature: (int [o]compression())
Types: (double)
$compression = plgcompression();
plgcompression($compression); # all arguments given
$compression->plgcompression;
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgdidev
Signature: (double [o]p_mar();double [o]p_aspect();double [o]p_jx();double [o]p_jy())
Types: (double)
($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);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgdiori
Signature: (double [o]p_rot())
Types: (double)
$p_rot = plgdiori();
plgdiori($p_rot); # all arguments given
$p_rot->plgdiori;
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgdiplt
Signature: (double [o]p_xmin();double [o]p_ymin();double [o]p_xmax();double [o]p_ymax())
Types: (double)
($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);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgfam
Signature: (int [o]p_fam();int [o]p_num();int [o]p_bmax())
Types: (double)
($p_fam, $p_num, $p_bmax) = plgfam();
plgfam($p_fam, $p_num, $p_bmax); # all arguments given
$p_fam->plgfam($p_num, $p_bmax);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plglevel
Signature: (int [o]p_level())
Types: (double)
$p_level = plglevel();
plglevel($p_level); # all arguments given
$p_level->plglevel;
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgpage
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)
($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);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgspa
Signature: (double [o]xmin();double [o]xmax();double [o]ymin();double [o]ymax())
Types: (double)
($xmin, $xmax, $ymin, $ymax) = plgspa();
plgspa($xmin, $xmax, $ymin, $ymax); # all arguments given
$xmin->plgspa($xmax, $ymin, $ymax);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgvpd
Signature: (double [o]p_xmin();double [o]p_xmax();double [o]p_ymin();double [o]p_ymax())
Types: (double)
($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);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgvpw
Signature: (double [o]p_xmin();double [o]p_xmax();double [o]p_ymin();double [o]p_ymax())
Types: (double)
($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);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgxax
Signature: (int [o]p_digmax();int [o]p_digits())
Types: (double)
($p_digmax, $p_digits) = plgxax();
plgxax($p_digmax, $p_digits); # all arguments given
$p_digmax->plgxax($p_digits);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgyax
Signature: (int [o]p_digmax();int [o]p_digits())
Types: (double)
($p_digmax, $p_digits) = plgyax();
plgyax($p_digmax, $p_digits); # all arguments given
$p_digmax->plgyax($p_digits);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgzax
Signature: (int [o]p_digmax();int [o]p_digits())
Types: (double)
($p_digmax, $p_digits) = plgzax();
plgzax($p_digmax, $p_digits); # all arguments given
$p_digmax->plgzax($p_digits);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
pljoin
Signature: (double xone();double yone();double xtwo();double ytwo())
Types: (double)
pljoin($xone, $yone, $xtwo, $ytwo); # all arguments given
$xone->pljoin($yone, $xtwo, $ytwo); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
pllightsource
Signature: (double x();double y();double z())
Types: (double)
pllightsource($x, $y, $z); # all arguments given
$x->pllightsource($y, $z); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
pllsty
Signature: (int lin())
Types: (double)
pllsty($lin); # all arguments given
$lin->pllsty; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plmtex
Signature: (double disp();double pos();double just(); char *side;char *text)
Types: (double)
plmtex($disp, $pos, $just, $side, $text); # all arguments given
$disp->plmtex($pos, $just, $side, $text); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plmtex3
Signature: (double disp();double pos();double just(); char *side;char *text)
Types: (double)
plmtex3($disp, $pos, $just, $side, $text); # all arguments given
$disp->plmtex3($pos, $just, $side, $text); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plpat
Signature: (int nlin();int inc(dima);int del(dima))
Types: (double)
plpat($nlin, $inc, $del); # all arguments given
$nlin->plpat($inc, $del); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plprec
Signature: (int setp();int prec())
Types: (double)
plprec($setp, $prec); # all arguments given
$setp->plprec($prec); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plpsty
Signature: (int patt())
Types: (double)
plpsty($patt); # all arguments given
$patt->plpsty; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plptex
Signature: (double x();double y();double dx();double dy();double just(); char *text)
Types: (double)
plptex($x, $y, $dx, $dy, $just, $text); # all arguments given
$x->plptex($y, $dx, $dy, $just, $text); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plptex3
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)
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
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plschr
Signature: (double def();double scale())
Types: (double)
plschr($def, $scale); # all arguments given
$def->plschr($scale); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscmap0n
Signature: (int ncolzero())
Types: (double)
plscmap0n($ncolzero); # all arguments given
$ncolzero->plscmap0n; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscmap1n
Signature: (int ncolone())
Types: (double)
plscmap1n($ncolone); # all arguments given
$ncolone->plscmap1n; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscol0
Signature: (int icolzero();int r();int g();int b())
Types: (double)
plscol0($icolzero, $r, $g, $b); # all arguments given
$icolzero->plscol0($r, $g, $b); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscolbg
Signature: (int r();int g();int b())
Types: (double)
plscolbg($r, $g, $b); # all arguments given
$r->plscolbg($g, $b); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscolor
Signature: (int color())
Types: (double)
plscolor($color); # all arguments given
$color->plscolor; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscompression
Signature: (int compression())
Types: (double)
plscompression($compression); # all arguments given
$compression->plscompression; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgDevs
$devices = plgDevs ()
Returns a HashRef of all device names (key) and their menu strings (value).
plgFileDevs
$devices = plgFileDevs ()
Returns a HashRef of file-oriented device names (key) and their menu strings (value).
plsdidev
Signature: (double mar();double aspect();double jx();double jy())
Types: (double)
plsdidev($mar, $aspect, $jx, $jy); # all arguments given
$mar->plsdidev($aspect, $jx, $jy); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsdimap
Signature: (int dimxmin();int dimxmax();int dimymin();int dimymax();double dimxpmm();double dimypmm())
Types: (double)
plsdimap($dimxmin, $dimxmax, $dimymin, $dimymax, $dimxpmm, $dimypmm); # all arguments given
$dimxmin->plsdimap($dimxmax, $dimymin, $dimymax, $dimxpmm, $dimypmm); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsdiori
Signature: (double rot())
Types: (double)
plsdiori($rot); # all arguments given
$rot->plsdiori; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsdiplt
Signature: (double xmin();double ymin();double xmax();double ymax())
Types: (double)
plsdiplt($xmin, $ymin, $xmax, $ymax); # all arguments given
$xmin->plsdiplt($ymin, $xmax, $ymax); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsdiplz
Signature: (double xmin();double ymin();double xmax();double ymax())
Types: (double)
plsdiplz($xmin, $ymin, $xmax, $ymax); # all arguments given
$xmin->plsdiplz($ymin, $xmax, $ymax); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
pl_setcontlabelparam
Signature: (double offset();double size();double spacing();int active())
Types: (double)
pl_setcontlabelparam($offset, $size, $spacing, $active); # all arguments given
$offset->pl_setcontlabelparam($size, $spacing, $active); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
pl_setcontlabelformat
Signature: (int lexp();int sigdig())
Types: (double)
pl_setcontlabelformat($lexp, $sigdig); # all arguments given
$lexp->pl_setcontlabelformat($sigdig); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsfam
Signature: (int fam();int num();int bmax())
Types: (double)
plsfam($fam, $num, $bmax); # all arguments given
$fam->plsfam($num, $bmax); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsmaj
Signature: (double def();double scale())
Types: (double)
plsmaj($def, $scale); # all arguments given
$def->plsmaj($scale); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsmin
Signature: (double def();double scale())
Types: (double)
plsmin($def, $scale); # all arguments given
$def->plsmin($scale); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsori
Signature: (int ori())
Types: (double)
plsori($ori); # all arguments given
$ori->plsori; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plspage
Signature: (double xp();double yp();int xleng();int yleng();int xoff();int yoff())
Types: (double)
plspage($xp, $yp, $xleng, $yleng, $xoff, $yoff); # all arguments given
$xp->plspage($yp, $xleng, $yleng, $xoff, $yoff); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plspause
Signature: (int pause())
Types: (double)
plspause($pause); # all arguments given
$pause->plspause; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsstrm
Signature: (int strm())
Types: (double)
plsstrm($strm); # all arguments given
$strm->plsstrm; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plssub
Signature: (int nx();int ny())
Types: (double)
plssub($nx, $ny); # all arguments given
$nx->plssub($ny); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plssym
Signature: (double def();double scale())
Types: (double)
plssym($def, $scale); # all arguments given
$def->plssym($scale); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plstar
Signature: (int nx();int ny())
Types: (double)
plstar($nx, $ny); # all arguments given
$nx->plstar($ny); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plstart
Signature: (int nx();int ny(); char *devname)
Types: (double)
plstart($nx, $ny, $devname); # all arguments given
$nx->plstart($ny, $devname); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plstripa
Signature: (int id();int pen();double x();double y())
Types: (double)
plstripa($id, $pen, $x, $y); # all arguments given
$id->plstripa($pen, $x, $y); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plstripd
Signature: (int id())
Types: (double)
plstripd($id); # all arguments given
$id->plstripd; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsvpa
Signature: (double xmin();double xmax();double ymin();double ymax())
Types: (double)
plsvpa($xmin, $xmax, $ymin, $ymax); # all arguments given
$xmin->plsvpa($xmax, $ymin, $ymax); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsxax
Signature: (int digmax();int digits())
Types: (double)
plsxax($digmax, $digits); # all arguments given
$digmax->plsxax($digits); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsxwin
Signature: (int window_id())
Types: (double)
plsxwin($window_id); # all arguments given
$window_id->plsxwin; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsyax
Signature: (int digmax();int digits())
Types: (double)
plsyax($digmax, $digits); # all arguments given
$digmax->plsyax($digits); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plszax
Signature: (int digmax();int digits())
Types: (double)
plszax($digmax, $digits); # all arguments given
$digmax->plszax($digits); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plvasp
Signature: (double aspect())
Types: (double)
plvasp($aspect); # all arguments given
$aspect->plvasp; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plvpas
Signature: (double xmin();double xmax();double ymin();double ymax();double aspect())
Types: (double)
plvpas($xmin, $xmax, $ymin, $ymax, $aspect); # all arguments given
$xmin->plvpas($xmax, $ymin, $ymax, $aspect); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plvpor
Signature: (double xmin();double xmax();double ymin();double ymax())
Types: (double)
plvpor($xmin, $xmax, $ymin, $ymax); # all arguments given
$xmin->plvpor($xmax, $ymin, $ymax); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plw3d
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)
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
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plwidth
Signature: (int width())
Types: (double)
plwidth($width); # all arguments given
$width->plwidth; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plwind
Signature: (double xmin();double xmax();double ymin();double ymax())
Types: (double)
plwind($xmin, $xmax, $ymin, $ymax); # all arguments given
$xmin->plwind($xmax, $ymin, $ymax); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plP_gpixmm
Signature: (double p_x(dima);double p_y(dima))
Types: (double)
plP_gpixmm($p_x, $p_y); # all arguments given
$p_x->plP_gpixmm($p_y); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscolbga
Signature: (int r();int g();int b();double a())
Types: (double)
plscolbga($r, $g, $b, $a); # all arguments given
$r->plscolbga($g, $b, $a); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscol0a
Signature: (int icolzero();int r();int g();int b();double a())
Types: (double)
plscol0a($icolzero, $r, $g, $b, $a); # all arguments given
$icolzero->plscol0a($r, $g, $b, $a); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plline
Signature: (x(n); y(n))
Types: (double)
Draws line segments along (x1,y1)->(x2,y2)->(x3,y3)->...
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:
plline($x, $y);
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);
Broadcasts over its inputs. Can't use POSIX threads.
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.
plpath
Signature: (int n(); x1(); x2(); y1(); y2())
Types: (double)
plpath($n, $x1, $x2, $y1, $y2); # all arguments given
$n->plpath($x1, $x2, $y1, $y2); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plcolorpoints
Signature: (x(n); y(n); z(n); int sym(); minz(); maxz())
Types: (double)
PDL-specific: Implements what amounts to a threaded version of plsym.
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:
plcolorpoints($x, $y, $z, $symbol_index, $minz, $maxz)
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
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsmem
Signature: (int maxx();int maxy();image(3,x,y))
Types: (byte)
plsmem($maxx, $maxy, $image); # all arguments given
$maxx->plsmem($maxy, $image); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plfbox
Signature: (xo(); yo())
Types: (double)
plfbox($xo, $yo); # all arguments given
$xo->plfbox($yo); # method call
Box drawing primitive, taken from PLPLOT bar graph example
Broadcasts over its inputs. Can't use POSIX threads.
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.
plfbox1
Signature: (xo(); yo(); bh(); w())
Types: (double)
plfbox1($xo, $yo, $bh, $w); # all arguments given
$xo->plfbox1($yo, $bh, $w); # method call
Box drawing primitive that allows specifying base height and width in addition to offset and height
Broadcasts over its inputs. Can't use POSIX threads.
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.
plunfbox
Signature: (xo(); yo())
Types: (double)
plunfbox($xo, $yo); # all arguments given
$xo->plunfbox($yo); # method call
Similar box drawing primitive, but without fill (just draw outline of box)
Broadcasts over its inputs. Can't use POSIX threads.
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.
plunfbox1
Signature: (xo(); yo(); bh(); w())
Types: (double)
plunfbox1($xo, $yo, $bh, $w); # all arguments given
$xo->plunfbox1($yo, $bh, $w); # method call
Box drawing primitive that allows specifying base height and width in addition to offset and height
Broadcasts over its inputs. Can't use POSIX threads.
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.
plParseOpts
Signature: (int [o] retval(); SV* argv; int mode)
Types: (double)
$retval = plParseOpts($argv, $mode);
plParseOpts($retval, $argv, $mode); # all arguments given
$retval = $argv->plParseOpts($mode); # method call
$retval->plParseOpts($argv, $mode);
Parse PLplot options given in @ARGV-like arrays
Broadcasts over its inputs. Can't use POSIX threads.
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.
plpoin
Signature: (x(n); y(n); int code())
Types: (double)
plpoin($x, $y, $code); # all arguments given
$x->plpoin($y, $code); # method call
Plots a character at the specified points
Broadcasts over its inputs. Can't use POSIX threads.
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.
plpoin3
Signature: (x(n); y(n); z(n); int code())
Types: (double)
plpoin3($x, $y, $z, $code); # all arguments given
$x->plpoin3($y, $z, $code); # method call
Plots a character at the specified points in 3 space
Broadcasts over its inputs. Can't use POSIX threads.
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.
plline3
Signature: (x(n); y(n); z(n))
Types: (double)
plline3($x, $y, $z); # all arguments given
$x->plline3($y, $z); # method call
Draw a line in 3 space
Broadcasts over its inputs. Can't use POSIX threads.
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.
plpoly3
Signature: (x(n); y(n); z(n); int draw(m); int ifcc())
Types: (double)
plpoly3($x, $y, $z, $draw, $ifcc); # all arguments given
$x->plpoly3($y, $z, $draw, $ifcc); # method call
Draws a polygon in 3 space
Broadcasts over its inputs. Can't use POSIX threads.
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.
plhist
Signature: (data(n); datmin(); datmax(); int nbin(); int oldwin())
Types: (double)
plhist($data, $datmin, $datmax, $nbin, $oldwin); # all arguments given
$data->plhist($datmin, $datmax, $nbin, $oldwin); # method call
Plot a histogram from unbinned data
Broadcasts over its inputs. Can't use POSIX threads.
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.
plfill
Signature: (x(n); y(n))
Types: (double)
plfill($x, $y); # all arguments given
$x->plfill($y); # method call
Area fill
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgradient
Signature: (x(n); y(n); angle())
Types: (double)
plgradient($x, $y, $angle); # all arguments given
$x->plgradient($y, $angle); # method call
Area fill with color gradient
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsym
Signature: (x(n); y(n); int code())
Types: (double)
plsym($x, $y, $code); # all arguments given
$x->plsym($y, $code); # method call
Plots a symbol at the specified points
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsurf3d
Signature: (x(nx); y(ny); z(nx,ny); int opt(); clevel(nlevel))
Types: (double)
plsurf3d($x, $y, $z, $opt, $clevel); # all arguments given
$x->plsurf3d($y, $z, $opt, $clevel); # method call
Plot shaded 3-d surface plot
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsurf3dl
Signature: (x(nx); y(ny); z(nx,ny); int opt(); clevel(nlevel); int indexxmin(); int indexxmax(); int indexymin(nx); int indexymax(nx))
Types: (double)
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
Plot shaded 3-d surface plot with limits
Broadcasts over its inputs. Can't use POSIX threads.
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.
plstyl
Signature: (int mark(nms); int space(nms))
Types: (double)
plstyl($mark, $space); # all arguments given
$mark->plstyl($space); # method call
Set line style
Broadcasts over its inputs. Can't use POSIX threads.
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.
plseed
Signature: (int seed())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
plseed($seed); # all arguments given
$seed->plseed; # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plrandd
Signature: (double [o]rand())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
$rand = plrandd();
plrandd($rand); # all arguments given
$rand->plrandd;
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plAllocGrid
Signature: (double xg(nx); double yg(ny); [o] PLcGridPtr__OUT grid)
Types: (double)
$grid = plAllocGrid($xg, $yg);
plAllocGrid($xg, $yg, $grid); # all arguments given
$grid = $xg->plAllocGrid($yg); # method call
$xg->plAllocGrid($yg, $grid);
Allocates a PLcGrid object for use in pltr1
Broadcasts over its inputs. Can't use POSIX threads.
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.
plAlloc2dGrid
Signature: (double xg(nx,ny); double yg(nx,ny); [o] PLcGrid2Ptr__OUT grid)
Types: (double)
$grid = plAlloc2dGrid($xg, $yg);
plAlloc2dGrid($xg, $yg, $grid); # all arguments given
$grid = $xg->plAlloc2dGrid($yg); # method call
$xg->plAlloc2dGrid($yg, $grid);
Allocates a PLcGrid2 object for use in pltr2
Broadcasts over its inputs. Can't use POSIX threads.
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.
init_pltr
Signature: (; SV* p0; SV* p1; SV* p2)
Types: (double)
init_pltr($p0, $p1, $p2); # all arguments given
$p0->init_pltr($p1, $p2); # method call
Used internally to set the variables pltr{0,1,2}_iv to the "pointers" of the Perl subroutines pltr{1,2,3}. These variables are later used by get_standard_pltrcb to provide the pointers to the C function pltr{0,1,2}. This accelerates functions like plcont and plshades when those standard transformation functions are used.
Broadcasts over its inputs. Can't use POSIX threads.
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.
plmap
Signature: (minlong(); maxlong(); minlat(); maxlat(); SV* mapform; char* type)
Types: (double)
plmap($minlong, $maxlong, $minlat, $maxlat, $mapform, $type); # all arguments given
$minlong->plmap($maxlong, $minlat, $maxlat, $mapform, $type); # method call
plot continental outline in world coordinates
Broadcasts over its inputs. Can't use POSIX threads.
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.
plstring
Signature: (x(na); y(na); char* string)
Types: (double)
plstring($x, $y, $string); # all arguments given
$x->plstring($y, $string); # method call
plot a string along a line
Broadcasts over its inputs. Can't use POSIX threads.
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.
plstring3
Signature: (x(na); y(na); z(na); char* string)
Types: (double)
plstring3($x, $y, $z, $string); # all arguments given
$x->plstring3($y, $z, $string); # method call
plot a string along a 3D line
Broadcasts over its inputs. Can't use POSIX threads.
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.
plmeridians
Signature: (dlong(); dlat(); minlong(); maxlong(); minlat(); maxlat(); SV* mapform)
Types: (double)
plmeridians($dlong, $dlat, $minlong, $maxlong, $minlat, $maxlat, $mapform); # all arguments given
$dlong->plmeridians($dlat, $minlong, $maxlong, $minlat, $maxlat, $mapform); # method call
Plot the latitudes and longitudes on the background
Broadcasts over its inputs. Can't use POSIX threads.
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.
plshades
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)
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
Shade regions on the basis of value
Broadcasts over its inputs. Can't use POSIX threads.
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.
plcont
Signature: (f(nx,ny); int kx(); int lx(); int ky(); int ly(); clevel(nlevel); SV* pltr; SV* pltr_data)
Types: (double)
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
Plot contours
Broadcasts over its inputs. Can't use POSIX threads.
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.
plmesh
Signature: (x(nx); y(ny); z(nx,ny); int opt())
Types: (double)
plmesh($x, $y, $z, $opt); # all arguments given
$x->plmesh($y, $z, $opt); # method call
Surface mesh
Broadcasts over its inputs. Can't use POSIX threads.
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.
plmeshc
Signature: (x(nx); y(ny); z(nx,ny); int opt(); clevel(nlevel))
Types: (double)
plmeshc($x, $y, $z, $opt, $clevel); # all arguments given
$x->plmeshc($y, $z, $opt, $clevel); # method call
Magnitude colored plot surface mesh with contour
Broadcasts over its inputs. Can't use POSIX threads.
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.
plot3d
Signature: (x(nx); y(ny); z(nx,ny); int opt(); int side())
Types: (double)
plot3d($x, $y, $z, $opt, $side); # all arguments given
$x->plot3d($y, $z, $opt, $side); # method call
3-d surface plot
Broadcasts over its inputs. Can't use POSIX threads.
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.
plot3dc
Signature: (x(nx); y(ny); z(nx,ny); int opt(); clevel(nlevel))
Types: (double)
plot3dc($x, $y, $z, $opt, $clevel); # all arguments given
$x->plot3dc($y, $z, $opt, $clevel); # method call
Plots a 3-d representation of the function z[x][y] with contour
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscmap1l
Signature: (int itype(); isty(n); coord1(n); coord2(n); coord3(n); int rev(nrev))
Types: (double)
plscmap1l($itype, $isty, $coord1, $coord2, $coord3, $rev); # all arguments given
$itype->plscmap1l($isty, $coord1, $coord2, $coord3, $rev); # method call
Set color map1 colors using a piece-wise linear relationship
Broadcasts over its inputs. Can't use POSIX threads.
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.
plshade1
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)
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
Shade individual region on the basis of value
Broadcasts over its inputs. Can't use POSIX threads.
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.
plimage
Signature: (idata(nx,ny); xmin(); xmax(); ymin(); ymax();zmin(); zmax(); Dxmin(); Dxmax(); Dymin(); Dymax())
Types: (double)
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
Plot gray-level image
Broadcasts over its inputs. Can't use POSIX threads.
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.
plimagefr
Signature: (idata(nx,ny); xmin(); xmax(); ymin(); ymax();zmin(); zmax(); valuemin(); valuemax(); SV* pltr; SV* pltr_data)
Types: (double)
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
Plot image with transformation
Broadcasts over its inputs. Can't use POSIX threads.
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.
plxormod
$status = plxormod ($mode)
Set xor mode: mode = 1-enter, 0-leave, status = 0 if not interactive device
See the PLplot manual for reference.
plGetCursor
%gin = plGetCursor ()
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.
plgstrm
$strm = plgstrm ()
Returns the number of the current output stream.
plgsdev
$driver = plgdev ()
Returns the current driver name.
plmkstrm
$strm = plmkstrm ()
Creates a new stream and makes it the default. Returns the number of the created stream.
plgver
$version = plgver ()
Get the current library version number
See the PLplot manual for reference.
plstripc
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)
$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);
FIXME: documentation here!
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgriddata
Signature: (x(npts); y(npts); z(npts); xg(nptsx); yg(nptsy);int type(); data(); [o] zg(nptsx,nptsy))
Types: (double)
$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);
FIXME: documentation here!
Broadcasts over its inputs. Can't use POSIX threads.
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.
plarc
plarc ($x, $y, $a, $b, $angle1, $angle2, $rotate, $fill);
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.
plstransform
plstransform ($subroutine_reference, $data);
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.
plslabelfunc
plslabelfunc ($subroutine_reference);
# 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.
pllegend
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);
See the PLplot manual for more details.
plspal0
plspal0($filename);
Set color palette 0 from the input .pal file. See the PLplot manual for more details.
plspal1
plspal1($filename);
Set color palette 1 from the input .pal file. See the PLplot manual for more details.
plbtime
my ($year, $month, $day, $hour, $min, $sec) = plbtime($ctime);
Calculate broken-down time from continuous time for current stream.
plconfigtime
plconfigtime($scale, $offset1, $offset2, $ccontrol, $ifbtime_offset, $year, $month, $day, $hour, $min, $sec);
Configure transformation between continuous and broken-down time (and vice versa) for current stream.
plctime
my $ctime = plctime($year, $month, $day, $hour, $min, $sec);
Calculate continuous time from broken-down time for current stream.
pltimefmt
pltimefmt($fmt);
Set format for date / time labels. Labels must be configured to treat values as seconds since the epoch via the XBOX/YBOX flags. $fmt is generally consistent with the POSIX strpformat/strftime flags, but see the PLplot manual for details.
plsesc
plsesc($esc);
Set the escape character for text strings. See the PLplot manual for more details.
plvect
Signature: (u(nx,ny); v(nx,ny); scale(); SV* pltr; SV* pltr_data)
Types: (double)
plvect($u, $v, $scale, $pltr, $pltr_data); # all arguments given
$u->plvect($v, $scale, $pltr, $pltr_data); # method call
Vector field plots
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsvect
Signature: (arrowx(npts); arrowy(npts); int fill())
Types: (double)
plsvect($arrowx, $arrowy, $fill); # all arguments given
$arrowx->plsvect($arrowy, $fill); # method call
Give zero-length PDLs for arrowx and arrowy to pass NULL to PLplot func.
Broadcasts over its inputs. Can't use POSIX threads.
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.
plhlsrgb
Signature: (double h();double l();double s();double [o]p_r();double [o]p_g();double [o]p_b())
Types: (double)
($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);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgcol0
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)
($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);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgcolbg
Signature: (int [o]r(); int [o]g(); int [o]b())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
($r, $g, $b) = plgcolbg();
plgcolbg($r, $g, $b); # all arguments given
$r->plgcolbg($g, $b);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscmap0
Signature: (int r(n); int g(n); int b(n))
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
plscmap0($r, $g, $b); # all arguments given
$r->plscmap0($g, $b); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscmap1
Signature: (int r(n); int g(n); int b(n))
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
plscmap1($r, $g, $b); # all arguments given
$r->plscmap1($g, $b); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgcol0a
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)
($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);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgcolbga
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)
($r, $g, $b, $a) = plgcolbga();
plgcolbga($r, $g, $b, $a); # all arguments given
$r->plgcolbga($g, $b, $a);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscmap0a
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)
plscmap0a($r, $g, $b, $a); # all arguments given
$r->plscmap0a($g, $b, $a); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscmap1a
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)
plscmap1a($r, $g, $b, $a); # all arguments given
$r->plscmap1a($g, $b, $a); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plscmap1la
Signature: (int itype(); isty(n); coord1(n); coord2(n); coord3(n); coord4(n); int rev(nrev))
Types: (double)
plscmap1la($itype, $isty, $coord1, $coord2, $coord3, $coord4, $rev); # all arguments given
$itype->plscmap1la($isty, $coord1, $coord2, $coord3, $coord4, $rev); # method call
Set color map1 colors using a piece-wise linear relationship, include alpha channel
Broadcasts over its inputs. Can't use POSIX threads.
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.
plgfont
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)
($p_family, $p_style, $p_weight) = plgfont();
plgfont($p_family, $p_style, $p_weight); # all arguments given
$p_family->plgfont($p_style, $p_weight);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plsfont
Signature: (int family(); int style(); int weight())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
plsfont($family, $style, $weight); # all arguments given
$family->plsfont($style, $weight); # method call
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
plcalc_world
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)
($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);
info not available
Broadcasts over its inputs. Can't use POSIX threads.
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.
pl_cmd
pl_cmd($CMD, $data);
See the PLplot manual for reference.
Gives access to low level driver. $CMD is an integer. $data opaque data.
pl_setCairoCtx
pl_setCairoCtx($cairo_context);
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.
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:
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] );Too many colors used! (max 15)
AUTHORS
Doug Hunt <dhunt@ucar.edu>
Rafael Laboissiere <rlaboiss@users.sourceforge.net>
David Mertens <mertens2@illinois.edu>
SEE ALSO
perl(1), PDL(1), http://www.plplot.org/
The other common graphics packages include PDL::Graphics::PGPLOT, PDL::Graphics::Simple and PDL::Graphics::TriD.