PDL::G...:State(3pm)
π NAME π
State β a package to keep track of plotting commands β¨ (it lives in the PDL::G...:State(3pm) man page, bestie, and it's literally the whole point of this doc)
πΈ SYNOPSIS πΈ
use PDL::Graphics::State;
That's it. That's the whole synopsis. Short, sweet, iconic π
π¦ DESCRIPTION π¦
Okay so this is a very simple package β like, at present almost trivial β and its entire job is keeping track of the current set of plotting commands. No cap, that's the vibe π
π USAGE π
β¨ making a new one β¨
You create a new object by calling the new operator:
$state = PDL::Graphics::State->new();
π adding commands π
Then, for each new command, you call add on this object. So if you have a call to line that looks like this:
line $x, $y, $opt;
β¦then the call to add would be like this:
$state->add(\&line, 'line', [$x, $y], $opt);
which gets stored internally as:
[\&line, 'line', [$x, $y], $opt]
Periodt. π«Ά
π getting it back out π
The state can later be extracted using get, which returns the state object. And that state object is an array of anonymous arrays just like the one up there π where:
- the first object is a reference to the function,
- the second is an anonymous array of arguments to the function,
- and finally an anonymous hash with options to the command.
π removing & the rest π
If you know the order in which you inserted commands, they can be removed by calling remove with the number in the stack.
No further interaction is implemented β like, none, zero, nada β except:
clear, which clears the stack π§Ήcopy, which returns a "deep" copy of the state π
β AUTHOR β
Jarle Brinchmann (jarle@astro.ox.ac.uk) β and this only exists after some prodding by Karl Glazebrook π iconic origin story fr fr.
All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. π«‘
and that's the whole page, bestie!! π This beauty is perl v5.42.3, dated 2026-08-21, and it lives at PDL::G...:State(3pm). Go forth and track those plotting commands, queen πβ¨
π¦ where this page comes from
- ubuntu stonking: libpgplot-perl 1:2.36-1build1 Β· 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