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 πŸ‘‘


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