Compare commits

...

20 Commits

Author SHA1 Message Date
Dima Kogan
5772f8894f changelog bump 2018-09-29 11:00:57 -07:00
Dima Kogan
958c6364c3 Merge tag 'v1.51' into debian 2018-09-29 11:00:01 -07:00
Dima Kogan
40fea5eb7f changelog bump 2018-09-29 10:57:37 -07:00
Dima Kogan
016c7ebfa9 Added a new .gp terminal to create self-plotting gnuplot scripts 2018-09-29 10:55:36 -07:00
Dima Kogan
744239b7b7 version bump 2018-08-24 13:16:40 -07:00
Dima Kogan
0c06f72d5d Merge branch 'master' into debian 2018-08-24 13:15:05 -07:00
Dima Kogan
350b2db022 version bump 2018-08-24 13:13:45 -07:00
Dima Kogan
ba0f2eee08 completion knows about the fnormal distribution 2018-08-24 13:13:45 -07:00
Dima Kogan
778825bd34 completion knows about the fnormal distribution 2018-08-24 13:11:57 -07:00
Dima Kogan
9237811ed0 Script waits for the plot window to close before exiting
Instead of sleeping forever. This is really nice! I no longer need to quit the
plot window AND then C-c. Quitting the plot window is now sufficient
2018-08-23 22:31:14 -07:00
Dima Kogan
69285d7df1 fixed typo in docs 2018-07-09 18:38:56 -07:00
Dima Kogan
e514b24e39 changelog update 2018-06-17 22:18:41 -07:00
Dima Kogan
88eeff7890 updated URLs to point to salsa 2018-04-19 08:12:29 -07:00
Dima Kogan
aedbc28afe by default --image sets range noextend
This is usually what I want
2018-04-10 00:51:30 -07:00
Dima Kogan
e167e057d3 changelog bump 2018-03-16 13:56:32 -07:00
Dima Kogan
38e92c5ba9 Merge branch 'master' into debian 2018-03-16 13:55:16 -07:00
Dima Kogan
e865871492 changelog bump 2018-03-16 13:53:57 -07:00
Dima Kogan
0f85110a38 --vnl now works with plots that have rangesize > 1 2018-03-16 13:50:49 -07:00
Dima Kogan
811d0d45ab new bash-completion install dir 2018-03-11 18:32:31 -07:00
Dima Kogan
5cf4acca62 zsh completion: --xlen argument isn't optional 2018-03-02 18:02:10 -08:00
6 changed files with 178 additions and 57 deletions

24
Changes
View File

@@ -1,3 +1,27 @@
feedgnuplot (1.51)
* Added .gp "terminal" to create self-plotting gnuplot files
-- Dima Kogan <dima@secretsauce.net> Sat, 29 Sep 2018 10:56:30 -0700
feedgnuplot (1.50)
* Script waits for the plot window to close before exiting
Instead of sleeping forever. This is really nice! I no longer need
to quit the plot window AND then C-c. Quitting the plot window is
now sufficient
* by default --image sets range noextend
* tab-completion knows about the fnormal distribution
-- Dima Kogan <dkogan@debian.org> Fri, 24 Aug 2018 13:11:05 -0700
feedgnuplot (1.49)
* --vnl now works with plots that have rangesize > 1
* zsh completion: --xlen argument isn't optional
-- Dima Kogan <dima@secretsauce.net> Fri, 16 Mar 2018 13:52:28 -0700
feedgnuplot (1.48)
* --vnlog works properly with --domain

View File

@@ -16,7 +16,7 @@ use Pod::Usage;
use Time::Piece;
# Makefile.PL assumes this is in ''
my $VERSION = '1.48';
my $VERSION = '1.51';
my %options;
interpretCommandline();
@@ -465,10 +465,13 @@ sub interpretCommandline
{
# images generally have the origin at the top-left instead of the
# bottom-left, so given nothing else, I flip the y axis
if( !defined $options{ymin} && !defined $options{ymax} &&
if( !defined $options{xmin} && !defined $options{xmax} &&
!defined $options{ymin} && !defined $options{ymax} &&
! any { /^ *xrange\b/ } @{$options{set}} &&
! any { /^ *yrange\b/ } @{$options{set}} )
{
push @{$options{set}}, "yrange [:] reverse";
push @{$options{set}}, "xrange [:] noextend";
push @{$options{set}}, "yrange [:] reverse noextend";
}
if ( ! -r $options{image} )
@@ -614,51 +617,15 @@ sub getNextLine
sub mainThread
{
local *PIPE;
my $dopersist = '';
if( getGnuplotVersion() >= 4.3 && # --persist not available before this
# --persist is needed for the "half-alive" state (see documentation for
# --exit). This state is only used with these options:
!$options{stream} && $options{exit})
{
$dopersist = '--persist';
}
# We trap SIGINT to kill the data input, but keep the plot up. see
# documentation for --exit
if ($options{stream} && !$options{exit})
{
$SIG{INT} = sub
{
print STDERR "$0 received SIGINT. Send again to quit\n";
$SIG{INT} = undef;
};
}
if(exists $options{dump})
{
*PIPE = *STDOUT;
}
else
{
my $geometry = defined $options{geometry} ?
"-geometry $options{geometry}" : '';
open PIPE, "|gnuplot $geometry $dopersist" or die "Can't initialize gnuplot\n";
}
autoflush PIPE 1;
my $outputfile;
my $outputfileType;
if( defined $options{hardcopy})
{
$outputfile = $options{hardcopy};
if( $outputfile =~ /^[^|] # starts with anything other than |
.* # stuff in the middle
\.(eps|ps|pdf|png|svg)$/ix) # ends with a known extension
if( $outputfile =~ /^[^|] # starts with anything other than |
.* # stuff in the middle
\.(eps|ps|pdf|png|svg|gp)$/ix) # ends with a known extension
{
$outputfileType = lc $1;
}
@@ -668,7 +635,8 @@ sub mainThread
ps => 'postscript noenhanced solid color landscape 12',
pdf => 'pdfcairo noenhanced solid color font ",12" size 11in,8.5in',
png => 'png noenhanced size 1280,1024',
svg => 'svg noenhanced');
svg => 'svg noenhanced',
gp => 'gp');
if( !defined $options{terminal} &&
defined $outputfileType &&
@@ -680,8 +648,89 @@ sub mainThread
die "Asked to plot to file '$outputfile', but I don't know which terminal to use, and no --terminal given"
unless $options{terminal};
}
print PIPE "set terminal $options{terminal}\n" if $options{terminal};
print PIPE "set output \"$outputfile\"\n" if $outputfile;
sub gpterminal
{
return defined $options{terminal} && $options{terminal} eq 'gp';
}
sub datadump_only
{
return
exists $options{dump} ||
gpterminal();
}
sub search_PATH
{
for my $pathdir (File::Spec->path())
{
my $gnuplot_execpath = File::Spec->catfile($pathdir, $_[0]);
return $gnuplot_execpath
if -x $gnuplot_execpath && ! -d $gnuplot_execpath;
}
return undef;
}
if(datadump_only())
{
if(gpterminal())
{
open PIPE, '>', $outputfile;
my $gnuplotpath = search_PATH('gnuplot');
if(!defined $gnuplotpath)
{
print STDERR "Couldn't find the gnuplot executable path. Creating .gp file still, but omitting #!. This will NOT be self-executable";
}
else
{
chmod 0755, $outputfile;
print PIPE "#!$gnuplotpath\n";
}
}
else
{
*PIPE = *STDOUT;
}
}
else
{
my $dopersist = '';
if ( getGnuplotVersion() >= 4.3 && # --persist not available before this
# --persist is needed for the "half-alive" state (see documentation for
# --exit). This state is only used with these options:
!$options{stream} && $options{exit}) {
$dopersist = '--persist';
}
# We trap SIGINT to kill the data input, but keep the plot up. see
# documentation for --exit
if ($options{stream} && !$options{exit})
{
$SIG{INT} = sub
{
print STDERR "$0 received SIGINT. Send again to quit\n";
$SIG{INT} = undef;
};
}
my $geometry = defined $options{geometry} ?
"-geometry $options{geometry}" : '';
open PIPE, "|gnuplot $geometry $dopersist" or die "Can't initialize gnuplot\n";
autoflush PIPE 1;
}
if(!gpterminal())
{
print PIPE "set terminal $options{terminal}\n" if $options{terminal};
print PIPE "set output \"$outputfile\"\n" if $outputfile;
}
# set up plotting style
my $style = '';
@@ -951,14 +1000,14 @@ sub mainThread
splice( @fields, 0, $rangesize ) ) . "\n",
$domain0_numeric);
$i_column++;
$i_column += $rangesize;
}
}
# finished reading in all. Plot what we have
plotStoredData() unless $options{stream} && $options{exit};
if ( defined $options{hardcopy})
if ( defined $options{hardcopy} && !gpterminal())
{
print PIPE "set output\n";
@@ -987,7 +1036,15 @@ sub mainThread
# we persist gnuplot, so we shouldn't need this sleep. However, once
# gnuplot exits, but the persistent window sticks around, you can no
# longer interactively zoom the plot. So we still sleep
sleep(100000000) unless $options{dump} || $options{exit};
if(gpterminal())
{
print PIPE "pause mouse close\n";
close PIPE;
}
elsif(!($options{dump} || $options{exit}))
{
print PIPE "pause mouse close\n";
}
}
sub pruneOldData
@@ -1410,7 +1467,7 @@ points palette>), variable sizes (C<with points ps variable>), labels and so on.
The feedgnuplot tool itself does not know about all these intricacies, but they
can still be used, by specifying the specific style with C<--style>, and
specifying how many values are needed for each point with any of
C<--rangesizeall, C<--tuplesizeall>, C<--rangesize>, C<--tuplesize>. These
C<--rangesizeall>, C<--tuplesizeall>, C<--rangesize>, C<--tuplesize>. These
options are required I<only> for styles not explicitly supported by feedgnuplot;
supported styles do the right thing automatically.
@@ -1534,15 +1591,20 @@ This command causes feedgnuplot to exit.
The script is able to produce hardcopy output with C<--hardcopy outputfile>. The
output type can be inferred from the filename, if B<.ps>, B<.eps>, B<.pdf>,
B<.svg> or B<.png> is requested. If any other file type is requested,
B<.svg>, B<.png> or B<.gp> is requested. If any other file type is requested,
C<--terminal> I<must> be passed in to tell gnuplot how to make the plot. If
C<--terminal> is passed in, then the C<--hardcopy> argument only provides the
output filename.
The B<.gp> output is special. Instead of asking gnuplot to plot to a particular
terminal, writing to a B<.gp> simply dumps a self-executable gnuplot script into
the given file. This is similar to what C<--dump> does, but writes to a file,
and makes sure that the file can be self-executing.
=head2 Self-plotting data files
This script can be used to enable self-plotting data files. There are 2 ways of
doing this: with a shebang (#!) or with inline perl data.
This script can be used to enable self-plotting data files. There are several
ways of doing this: with a shebang (#!) or with inline perl data.
=head3 Self-plotting data with a #!
@@ -1576,6 +1638,11 @@ characters and that the full path to feedgnuplot must be given. The 127
character limit is a serious limitation, but this can likely be resolved with a
kernel patch. I have only tried on Linux 2.6.
=head3 Self-plotting data with gnuplot
Running C<feedgnuplot --hardcopy plotdata.gp ....> will create a self-executable
gnuplot script in C<plotdata.gp>
=head3 Self-plotting data with perl inline data
Perl supports storing data and code in the same file. This can also be used to

View File

@@ -16,7 +16,7 @@ _arguments -S
'--zlabel:Z-axis label:' \
'--title:Plot title:' \
'--autolegend[Label each plot with its data ID]' \
'(--3d)--xlen[the size of the x-window to plot]::window size:' \
'(--3d)--xlen[the size of the x-window to plot]:window size:' \
'(--xlen)--xmin:min X:' \
'(--xlen)--xmax:max X:' \
'--ymin:min Y:' \
@@ -48,7 +48,7 @@ _arguments -S
'*--style[Additional styles for a curve]:curve id: :style:' \
'(--3d)*--histogram:plot to treat as a histogram:' \
'--binwidth:Histogram bin width:' \
'--histstyle:Style of histogram:(frequency unique cumulative cnormal)' \
'--histstyle:Style of histogram:(frequency fnormal unique cumulative cnormal)' \
'--terminal:Terminal options to set with "set terminal":' \
'*--legend[Legend for a curve]:curve id: :legend:' \
'--exit[Exit gnuplot after making the plot]' \

30
debian/changelog vendored
View File

@@ -1,3 +1,33 @@
feedgnuplot (1.51-1) unstable; urgency=medium
* Added .gp "terminal" to create self-plotting gnuplot files
-- Dima Kogan <dkogan@debian.org> Sat, 29 Sep 2018 11:00:40 -0700
feedgnuplot (1.50-1) unstable; urgency=medium
* Script waits for the plot window to close before exiting
Instead of sleeping forever. This is really nice! I no longer need
to quit the plot window AND then C-c. Quitting the plot window is
now sufficient
* by default --image sets range noextend
* tab-completion knows about the fnormal distribution
-- Dima Kogan <dkogan@debian.org> Fri, 24 Aug 2018 13:16:35 -0700
feedgnuplot (1.49-2) unstable; urgency=medium
* Updated Vcs-... tags to salsa
-- Dima Kogan <dkogan@debian.org> Sun, 17 Jun 2018 22:18:18 -0700
feedgnuplot (1.49-1) unstable; urgency=medium
* --vnl now works with plots that have rangesize > 1
* zsh completion: --xlen argument isn't optional
-- Dima Kogan <dkogan@debian.org> Fri, 16 Mar 2018 13:56:27 -0700
feedgnuplot (1.48-1) unstable; urgency=medium
* Added --tuplesize and --tuplesizeall

4
debian/control vendored
View File

@@ -6,8 +6,8 @@ Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.
Uploaders: Dima Kogan <dima@secretsauce.net>
Standards-Version: 3.9.4
Homepage: https://github.com/dkogan/feedgnuplot
Vcs-Git: git://anonscm.debian.org/debian-science/packages/feedgnuplot.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-science/packages/feedgnuplot.git
Vcs-Browser: https://salsa.debian.org/science-team/feedgnuplot
Vcs-Git: https://salsa.debian.org/science-team/feedgnuplot.git
Package: feedgnuplot
Architecture: all

View File

@@ -1,2 +1,2 @@
completions/bash/feedgnuplot /etc/bash_completion.d/
completions/bash/feedgnuplot /usr/share/bash-completion/completions/
completions/zsh/_feedgnuplot /usr/share/zsh/vendor-completions