Skip to content

Instantly share code, notes, and snippets.

@wu
Created January 25, 2010 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wu/e90670b47aca7ad315c9 to your computer and use it in GitHub Desktop.
Save wu/e90670b47aca7ad315c9 to your computer and use it in GitHub Desktop.
# interactive gnuplot terminal
use Hook::LexWrap;
wrap 'Chart::Gnuplot::_execute',
pre => sub { my ( $self ) = @_;
# if this isn't an x11 terminal, there's nothing to do
return unless $self->{terminal} eq "x11";
# add 'pause' command to script to keep image from immediately disappearing
open(GPH, ">>$self->{_script}") || confess("Can't write $self->{_script}");
print GPH "\npause mouse button1\n";
close(GPH);
# output is not a file, delete the 'output' param or we'll get an error in _execute
delete $self->{output};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment