PDL::G...:State(3pm)

πŸ“¦
version 2.36 Β· 2 versions
, in ubuntu stonking

πŸ’– 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