mirror of
https://github.com/dkogan/feedgnuplot.git
synced 2025-09-18 10:28:12 +08:00
Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9cc67cdaeb | ||
![]() |
07a109b09a | ||
![]() |
7b3040ecc9 | ||
![]() |
b59137c255 | ||
![]() |
fec440c8b3 | ||
![]() |
5758865246 | ||
![]() |
6f091d1cf2 | ||
![]() |
1c853a2193 | ||
![]() |
defcf5ef59 | ||
![]() |
ba112a3bd9 | ||
![]() |
7d7511e62e | ||
![]() |
1744aeb6d2 | ||
![]() |
53f6cdae5b |
29
Changes
29
Changes
@@ -1,4 +1,27 @@
|
||||
feedgnuplot (1.42) unstable; urgency=medium
|
||||
feedgnuplot (1.45)
|
||||
|
||||
* zsh completion: --hardcopy, --image suggest filenames
|
||||
* --image now produces a nicer legend: just the filename
|
||||
* --curvestyle now overrides --curvestyleall
|
||||
- This is a bug fix
|
||||
* The version is now treated as a string not as a number
|
||||
- So "1.40" is distinct from "1.4"
|
||||
|
||||
-- Dima Kogan <dima@secretsauce.net> Sun, 29 Oct 2017 13:56:28 -0700
|
||||
|
||||
feedgnuplot (1.44)
|
||||
|
||||
* --image draws its output beneath everything else
|
||||
|
||||
-- Dima Kogan <dima@secretsauce.net> Tue, 20 Jun 2017 16:44:30 -0700
|
||||
|
||||
feedgnuplot (1.43)
|
||||
|
||||
* Added --image
|
||||
|
||||
-- Dima Kogan <dima@secretsauce.net> Mon, 19 Jun 2017 13:12:38 -0700
|
||||
|
||||
feedgnuplot (1.42)
|
||||
|
||||
* Data can now come from STDIN or files on the cmdline.
|
||||
This fixes a regression. Self-plotting data files work again
|
||||
@@ -31,8 +54,8 @@ feedgnuplot (1.39)
|
||||
feedgnuplot (1.38)
|
||||
|
||||
* hardcopy defaults:
|
||||
- no enhanced text mode
|
||||
- larger font size
|
||||
- no enhanced text mode
|
||||
- larger font size
|
||||
|
||||
-- Dima Kogan <dima@secretsauce.net> Wed, 27 Jul 2016 22:15:11 -0700
|
||||
|
||||
|
@@ -20,9 +20,9 @@ sub parseversion
|
||||
|
||||
while(<PL>)
|
||||
{
|
||||
if( /VERSION = ([0-9\.]+)/ )
|
||||
if( /VERSION = '([0-9\.]+)'/ )
|
||||
{
|
||||
if ( $1 != $version )
|
||||
if ( $1 ne $version )
|
||||
{
|
||||
die "Version mismatch. Changes says version is '$version', but 'bin/feedgnuplot' says it is '$1'";
|
||||
}
|
||||
|
@@ -15,7 +15,8 @@ use Text::ParseWords; # for shellwords
|
||||
use Pod::Usage;
|
||||
use Time::Piece;
|
||||
|
||||
my $VERSION = 1.42;
|
||||
# Makefile.PL assumes this is in ''
|
||||
my $VERSION = '1.45';
|
||||
|
||||
my %options;
|
||||
interpretCommandline();
|
||||
@@ -109,6 +110,7 @@ sub interpretCommandline
|
||||
'style=s{2}', 'curvestyle=s{2}', 'curvestyleall=s', 'styleall=s', 'with=s', 'extracmds=s@', 'set=s@', 'unset=s@',
|
||||
'square!', 'square_xy!', 'hardcopy=s', 'maxcurves=i', 'monotonic!', 'timefmt=s',
|
||||
'equation=s@',
|
||||
'image=s',
|
||||
'histogram=s@', 'binwidth=f', 'histstyle=s',
|
||||
'terminal=s',
|
||||
'rangesize=s{2}', 'rangesizeall=i', 'extraValuesPerPoint=i',
|
||||
@@ -419,6 +421,27 @@ sub interpretCommandline
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# deal with --image. I just fill in --equation, and reverse the y extents if
|
||||
# none are explicitly given
|
||||
if( defined $options{image} )
|
||||
{
|
||||
# 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} &&
|
||||
! any { /^ *yrange\b/ } @{$options{set}} )
|
||||
{
|
||||
push @{$options{set}}, "yrange [:] reverse";
|
||||
}
|
||||
|
||||
if ( ! -r $options{image} )
|
||||
{
|
||||
die "Couldn't read image '$options{image}'";
|
||||
}
|
||||
|
||||
unshift @{$options{equation}}, qq{"$options{image}" binary filetype=auto flipy with rgbimage title "$options{image}"};
|
||||
delete $options{image};
|
||||
}
|
||||
}
|
||||
|
||||
sub getGnuplotVersion
|
||||
@@ -697,11 +720,6 @@ sub mainThread
|
||||
print(PIPE "set xdata time\n");
|
||||
}
|
||||
|
||||
# add the extra global options
|
||||
print(PIPE "$_\n") foreach (@{$options{extracmds}});
|
||||
print(PIPE "set $_\n") foreach (@{$options{set}});
|
||||
print(PIPE "unset $_\n") foreach (@{$options{unset}});
|
||||
|
||||
# set up histograms
|
||||
$options{binwidth} ||= 1; # if no binwidth given, set it to 1
|
||||
print PIPE
|
||||
@@ -724,6 +742,11 @@ sub mainThread
|
||||
sendRangeCommand( "zrange", $options{zmin}, $options{zmax} );
|
||||
sendRangeCommand( "cbrange", $options{zmin}, $options{zmax} ) if($options{colormap});
|
||||
|
||||
# add the extra global options
|
||||
print(PIPE "$_\n") foreach (@{$options{extracmds}});
|
||||
print(PIPE "set $_\n") foreach (@{$options{set}});
|
||||
print(PIPE "unset $_\n") foreach (@{$options{unset}});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -956,7 +979,8 @@ sub updateCurveOptions
|
||||
$usingoptions = "using 1:" . join(':', @rest);
|
||||
}
|
||||
|
||||
$curve->{options} = "$histoptions $usingoptions $titleoption $curve->{extraoptions} $options{curvestyleall}";
|
||||
|
||||
$curve->{options} = "$histoptions $usingoptions $titleoption $curve->{extraoptions}";
|
||||
}
|
||||
|
||||
sub getCurve
|
||||
@@ -975,7 +999,11 @@ sub getCurve
|
||||
|
||||
if( !exists $curveIndices{$id} )
|
||||
{
|
||||
push @curves, {extraoptions => ' ',
|
||||
push @curves, {# if we have a catch-all style and no specific style, use
|
||||
# the catch-all style
|
||||
extraoptions => (!exists $options{curvestyle_hash}{$id} &&
|
||||
exists $options{curvestyleall}) ?
|
||||
"$options{curvestyleall} " : ' ',
|
||||
datastring => '',
|
||||
datastring_meta => [],
|
||||
datastring_offset => 0}; # push a curve with no data and no options
|
||||
@@ -1729,6 +1757,17 @@ times.
|
||||
|
||||
=item
|
||||
|
||||
C<--image filename>
|
||||
|
||||
Overlays the data on top of a raster image given in C<filename>. This is passed
|
||||
through to gnuplot via C<--equation>, and is not interpreted by C<feedgnuplot>
|
||||
other than checking for existence. Usually images have their origin at the
|
||||
top-left corner, while plots have it in the bottom-left corner instead. Thus if
|
||||
the y-axis extents are not specified (C<--ymin>, C<--ymax>, C<--set 'yrange
|
||||
...'>) this option will also flip around the y axis to make the image appear
|
||||
properly. Since this option is just a passthrough to gnuplot, finer control can
|
||||
be achieved by passing in C<--equation> and C<--set yrange ...> directly.
|
||||
|
||||
C<--equation xxx>
|
||||
|
||||
Gnuplot can plot both data and symbolic equations. C<feedgnuplot> generally
|
||||
@@ -1993,11 +2032,21 @@ in a Thinkpad.
|
||||
|
||||
=head2 Plotting points on top of an existing image
|
||||
|
||||
This can be done by using C<--equation> to pass arbitrary plot input to gnuplot:
|
||||
This can be done with C<--image>:
|
||||
|
||||
$ < features_xy.data
|
||||
feedgnuplot --points --domain --image "image.png"
|
||||
|
||||
or with C<--equation>:
|
||||
|
||||
$ < features_xy.data
|
||||
feedgnuplot --points --domain
|
||||
--equation '"image.png" binary filetype=png flipy with rgbimage'
|
||||
--equation '"image.png" binary filetype=auto flipy with rgbimage'
|
||||
--set 'yrange [:] reverse'
|
||||
|
||||
The C<--image> invocation is a convenience wrapper for the C<--equation>
|
||||
version. Finer control is available with C<--equation>.
|
||||
|
||||
|
||||
Here an existing image is given to gnuplot verbatim, and data to plot on top of
|
||||
it is interpreted by feedgnuplot as usual. C<flipy> is useful here because
|
||||
|
@@ -21,6 +21,7 @@ complete -W \
|
||||
--set \
|
||||
--unset \
|
||||
--equation \
|
||||
--image \
|
||||
--geometry \
|
||||
--hardcopy \
|
||||
--help \
|
||||
|
@@ -33,9 +33,10 @@ _arguments -S
|
||||
'*--set[Additional 'set' gnuplot commands]:set-option' \
|
||||
'*--unset[Additional 'unset' gnuplot commands]:unset-option' \
|
||||
'*--equation[Raw symbolic equation]:equation' \
|
||||
'--image[Image file to render beneath the data]:image:_files -g "(#i)*.(jpg|jpeg|png|gif)"' \
|
||||
'--square[Plot data with square aspect ratio]' \
|
||||
'--square_xy[For 3D plots, set square aspect ratio for ONLY the x,y axes]' \
|
||||
'--hardcopy[Plot to a file]:filename' \
|
||||
'--hardcopy[Plot to a file]:new image filename:_files -g "(#i)*.(jpg|jpeg|png|gif)"' \
|
||||
'--maxcurves[The maximum allowed number of curves]:number of curves' \
|
||||
'(--3d)--monotonic[Resets plot if an X in the past is seen]' \
|
||||
'(--rangesizeall)--extraValuesPerPoint[How many extra values are given for each data range]:N'\
|
||||
|
Reference in New Issue
Block a user