secret
Created

  • Download Gist
interactive Chart::Gnuplot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 
# 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};
};

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.