Libplot(3pm)
π NAME π
Graphics::Libplot β a Perl extension for the libplot plotting library. bestie, it's a man page from the User Contributed Perl Documentation corner of the world (that's <pink>Libplot(3pm)</pink>, iykyk) and it's about to make your plots iconic β¨
π SYNOPSIS π
use Graphics::Libplot ':All';
that's literally it to get started, no cap π
β¨ DESCRIPTION β¨
okay so. this module lets you make plots by calling the routines in the libplot library, and the libplot library itself comes bundled inside the plotutils package π«Ά
there's a wrapper in here for every single published C function. every one. so the section of the plotutils info pages about programming in C is your main reference β go read that, fr fr π
there are a few possible confusions tho, and they're noted below π
so here's the tea: libplot has three different api's. this perl module gives you an interface to the second one π it's the same as the most recent api, except that the functions are not re-entrant π the api supported here is described in the section "Older C application programming interfaces" in the libplot manual.
some of the C routines want character constants rather than strings, which is a whole vibe π when you use the equivalent perl function, you have to wrap that character with the 'ord' function. for instance:
alabel(ord 'c', ord 'c', "some text");
and that will write some centered text. periodt π
also important: there is another, unrelated perl-module interface to GNU libplot, and it's called "Graphics::Plotter". don't get them confused bestie, they are not the same π«
π EXPORTING FUNCTIONS π
none of the libplot functions are exported by default. so if you don't import any functions, you have to prepend the module name to each function π
to call the pl_openpl() function you'd say:
Graphics::Libplot::pl_openpl();
however β if you include the library with:
use Graphics::Libplot ':All'
then all of the functions get exported and you do NOT need to prepend the module name π but be careful in that case, because there are many function names which may collide with others in your program β οΈ like, watch out.
on the other hand, you can use one of:
use Graphics::Libplot ':INTEGERLOW'
use Graphics::Libplot ':FLOATLOW'
to get just integer or just floating point plotting π§
be aware that the interface is still under development π§ so more names will be added, and your scripts may need to be changed. it's giving evolving, and honestly we respect the growth π
π¦ EXAMPLES π¦
there are additional examples included in the source distribution! (on Debian systems they live in /usr/share/doc/libgraphics-libplot-perl/examples π)
this example draws a spiraling box pattern and it ate, fr:
use Graphics::Libplot ':ALL';
# type of plotting device
$device = 'X';
if (@ARGV) {
$device = $ARGV[0];
die "Uknown device: $ARGV[0]" unless $ARGV[0] =~ /^ps|X|fig$/;
}
{ # environment for local variables
my $SIZE=100;
my ($i,$f,$s,$sf);
pl_parampl ("BITMAPSIZE", "700x700");
$handle = pl_newpl($device, stdin, stdout, stderr); # open xwindow display
pl_selectpl($handle);
pl_openpl();
pl_fspace(-$SIZE,-$SIZE, $SIZE, $SIZE); # specify user coord system
pl_pencolorname ("blue");
pl_fontname("HersheySerif");
$s = 10;
$f = 10;
$sf = 1- .0012;
for($i=1;$i<3000;$i++){
pl_fscale($sf,$sf);
pl_fbox(60+$s*sin($i/$f),
60+$s*sin($i/$f),
75-$s*cos($i/$f),
75-$s*cos($i/$f));
pl_frotate(1);
}
}
pl_closepl();
pl_selectpl(0);
pl_deletepl($handle);
the die "Uknown device: ..." message is spelled exactly like that in the source, bestie β we keep it verbatim and we do not fix it π
π BUGS π
- the newest API is not supported. period.
- there is no test suite with this module, so it is not clear that everything works correctly π like, we're out here trusting the process and it's a little scary ngl
πΈ AUTHOR πΈ
John Lapeyre <lapeyre@physics.arizona.edu> wrote this perl interface π«Ά
the libplot C library is developed by Robert Maier π
π COPYRIGHT π
libplot-perl is copyrighted by John Lapeyre and may be distributed only under the terms of either the Gnu General Public License, or of the perl Artistic License βοΈ (yes, only those two β read your license bestie)
β SEE ALSO β
and that's the whole page, bestie!! this was perl v5.42.3, dated 2026-08-19, and it served cunt β mwah π
π¦ where this page comes from
- ubuntu stonking: libgraphics-libplot-perl 2.2.4-1build2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms