PGPLOT::Device::PGWin - convenience class for PDL::Graphics::PGPLOT::Window
version 0.09
$pgwin = PGPLOT::Device::PGWin->new( { device => $user_device_spec, WinOpts => \%opts } ); $pgwin->override( $override ); $win = $pgwin->next; $win->env( ... ); $pgwin->finish;
PGPLOT::Device::PGWin is a convenience class which combines PGPLOT::Device and PDL::Graphics::PGPLOT::Window. It provides the logic to handle interactive devices (as illustrated in the Examples section of the PGPLOT::Device documentation).
Note that the "close" in PDL::Graphics::PGPLOT::Window method should never be called when using this module, as that will surely mess things up.
$pgwin = PGPLOT::Device::PGWin->new( \%opts );
Create a new object. The possible options are:
The device specification. This is passed directly to "new" in PGPLOT::Device, so see it's documentation.
A hashref containing options to pass to "new" in PGPLOT::Device.
A hashref containing options to pass to "new" in PDL::Graphics::PGPLOT::Windows. Do not include a Device option as that will break things.
Device
$dev = $pgwin->device
This method returns the underlying PGPLOT::Device object.
$win = $pgwin->next( ); $win = $pgwin->next( $override );
This method returns the window handle to use for constructing the next plot. If the optional argument is specified, it is equivalent to the following call sequence:
$pgwin->override( $override ); $pgwin->next;
$pgwin->override( ... );
This is calls the override method of the associated PGPLOT::Device object.
$pgwin->finish();
Close the associated device. This must be called to handle prompting for ephemeral interactive graphic devices before a program finishes execution.
This is not automatically called upon object destruction as there seems to be an ordering problem in destructors called during Perl's cleanup phase such that the underlying PDL::Graphics::PGPLOT::Window object is destroyed before this object.
my $pgwin = PGPLOT::Device::PGWin->new( { Device => $user_spec } ); eval { for my $plot in ( qw/ plot1 plot2 / ) { $pgwin->override( $plot ); my $win = $pgwin->next(); $win->env( ... ); ... } }; my $error = $@; $pgwin->finish; die $error if $error;
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=PGPLOT-Device or by email to bug-PGPLOT-Device@rt.cpan.org.
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
The development version is on github at https://github.com/djerius/pgplot-device and may be cloned from git://github.com/djerius/pgplot-device.git
Please see those modules/websites for more information related to this module.
PGPLOT::Device
PGPLOT
PDL
PDL::Graphics::PGPLOT::Window
Diab Jerius <djerius@cpan.org>
This software is Copyright (c) 2017 by Smithsonian Astrophysical Observatory.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007
To install PGPLOT::Device, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PGPLOT::Device
CPAN shell
perl -MCPAN -e shell install PGPLOT::Device
For more information on module installation, please visit the detailed CPAN module installation guide.