mirror of
https://github.com/dkogan/feedgnuplot.git
synced 2025-05-05 22:11:12 +08:00
added --with
This commit is contained in:
parent
1e3d01edd2
commit
35901fe6d1
@ -116,11 +116,14 @@ sub interpretCommandline
|
|||||||
$options{set} = [];
|
$options{set} = [];
|
||||||
$options{unset} = [];
|
$options{unset} = [];
|
||||||
|
|
||||||
|
$options{curvestyleall} = '';
|
||||||
|
$options{with} = '';
|
||||||
|
|
||||||
GetOptions(\%options, 'stream:s', 'domain!', 'dataid!', '3d!', 'colormap!', 'lines!', 'points!',
|
GetOptions(\%options, 'stream:s', 'domain!', 'dataid!', '3d!', 'colormap!', 'lines!', 'points!',
|
||||||
'circles', 'legend=s{2}', 'autolegend!', 'xlabel=s', 'ylabel=s', 'y2label=s', 'zlabel=s',
|
'circles', 'legend=s{2}', 'autolegend!', 'xlabel=s', 'ylabel=s', 'y2label=s', 'zlabel=s',
|
||||||
'title=s', 'xlen=f', 'ymin=f', 'ymax=f', 'xmin=s', 'xmax=s', 'y2min=f', 'y2max=f',
|
'title=s', 'xlen=f', 'ymin=f', 'ymax=f', 'xmin=s', 'xmax=s', 'y2min=f', 'y2max=f',
|
||||||
'zmin=f', 'zmax=f', 'y2=s@',
|
'zmin=f', 'zmax=f', 'y2=s@',
|
||||||
'curvestyle=s{2}', 'curvestyleall=s', 'extracmds=s@', 'set=s@', 'unset=s@',
|
'curvestyle=s{2}', 'curvestyleall=s', 'with=s', 'extracmds=s@', 'set=s@', 'unset=s@',
|
||||||
'square!', 'square_xy!', 'hardcopy=s', 'maxcurves=i', 'monotonic!', 'timefmt=s',
|
'square!', 'square_xy!', 'hardcopy=s', 'maxcurves=i', 'monotonic!', 'timefmt=s',
|
||||||
'histogram=s@', 'binwidth=f', 'histstyle=s',
|
'histogram=s@', 'binwidth=f', 'histstyle=s',
|
||||||
'terminal=s',
|
'terminal=s',
|
||||||
@ -144,9 +147,6 @@ sub interpretCommandline
|
|||||||
exit 0;
|
exit 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
# no global style if one isn't given
|
|
||||||
$options{curvestyleall} = '' unless defined $options{curvestyleall};
|
|
||||||
|
|
||||||
# expand options that are given as comma-separated lists
|
# expand options that are given as comma-separated lists
|
||||||
for my $listkey (qw(histogram y2))
|
for my $listkey (qw(histogram y2))
|
||||||
{
|
{
|
||||||
@ -209,6 +209,17 @@ sub interpretCommandline
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( $options{curvestyleall} && $options{with} )
|
||||||
|
{
|
||||||
|
print STDERR "--curvestyleall and --with are mutually exclusive. Please just use one.\n";
|
||||||
|
exit -1;
|
||||||
|
}
|
||||||
|
if( $options{with} )
|
||||||
|
{
|
||||||
|
$options{curvestyleall} = "with $options{with}";
|
||||||
|
$options{with} = '';
|
||||||
|
}
|
||||||
|
|
||||||
if ($options{colormap})
|
if ($options{colormap})
|
||||||
{
|
{
|
||||||
# colormap styles all curves with palette. Seems like there should be a way to do this with a
|
# colormap styles all curves with palette. Seems like there should be a way to do this with a
|
||||||
@ -778,9 +789,17 @@ sub updateCurveOptions
|
|||||||
|
|
||||||
my $titleoption = defined $title ? "title \"$title\"" : "notitle";
|
my $titleoption = defined $title ? "title \"$title\"" : "notitle";
|
||||||
|
|
||||||
my $curvestyleall = '';
|
my ($curvestyleall);
|
||||||
$curvestyleall = $options{curvestyleall}
|
if( defined $options{curvestyle_hash}{$id} )
|
||||||
if defined $options{curvestyleall} && !defined $options{curvestyle_hash}{$id};
|
{
|
||||||
|
# I have a curve-specific style set with --curvestyle. This style lives in
|
||||||
|
# $curve->{extraoptions}, and it overrides the global styles
|
||||||
|
$curvestyleall = '';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$curvestyleall = $options{curvestyleall};
|
||||||
|
}
|
||||||
|
|
||||||
my $histoptions = $curve->{histoptions} || '';
|
my $histoptions = $curve->{histoptions} || '';
|
||||||
|
|
||||||
@ -1025,8 +1044,15 @@ in C<--extracmds 'unset grid'>. Commands C<--set> and C<--unset> exists to
|
|||||||
provide nicer syntax, so this is equivalent to passing C<--unset grid>. As many
|
provide nicer syntax, so this is equivalent to passing C<--unset grid>. As many
|
||||||
of these options as needed can be passed in. To add arbitrary curve styles, use
|
of these options as needed can be passed in. To add arbitrary curve styles, use
|
||||||
C<--curvestyle curveID extrastyle>. Pass these more than once to affect more
|
C<--curvestyle curveID extrastyle>. Pass these more than once to affect more
|
||||||
than one curve. To apply an extra style to I<all> the curves that lack an
|
than one curve.
|
||||||
explicit C<--curvestyle>, pass in C<--curvestyleall extrastyle>.
|
|
||||||
|
To apply an extra style to I<all> the curves that lack an explicit
|
||||||
|
C<--curvestyle>, pass in C<--curvestyleall extrastyle>. In the most common case,
|
||||||
|
the extra style is C<with something>. To support this more simply, you can pass
|
||||||
|
in C<--with something> instead of C<--curvestyleall 'with something'>.
|
||||||
|
C<--curvestyleall> and C<--with> are mutually exclusive. Furthermore any
|
||||||
|
curve-specific C<--curvestyle> overrides the global C<--curvestyleall> or
|
||||||
|
C<--with> setting.
|
||||||
|
|
||||||
=head2 Data formats
|
=head2 Data formats
|
||||||
|
|
||||||
@ -1421,10 +1447,10 @@ something like
|
|||||||
Set up a this specific curve to plot a histogram. The bin width is given with
|
Set up a this specific curve to plot a histogram. The bin width is given with
|
||||||
the --binwidth option (assumed 1.0 if omitted). --histogram does NOT touch the
|
the --binwidth option (assumed 1.0 if omitted). --histogram does NOT touch the
|
||||||
drawing style. It is often desired to plot these with boxes, and this MUST be
|
drawing style. It is often desired to plot these with boxes, and this MUST be
|
||||||
explicitly requested with --curvestyleall 'with boxes'. This works with --domain
|
explicitly requested by C<--with boxes>. This works with --domain and/or
|
||||||
and/or --stream, but in those cases the x-value is used ONLY to cull old data
|
--stream, but in those cases the x-value is used ONLY to cull old data because
|
||||||
because of --xlen or --monotonic. I.e. the x-values are NOT drawn in any way.
|
of --xlen or --monotonic. I.e. the x-values are NOT drawn in any way. Can be
|
||||||
Can be passed multiple times, or passed a comma- separated list
|
passed multiple times, or passed a comma- separated list
|
||||||
|
|
||||||
=item
|
=item
|
||||||
|
|
||||||
@ -1457,7 +1483,22 @@ multiple curves. --curvestylall does NOT apply to curves that have a
|
|||||||
|
|
||||||
--curvestyleall xxx
|
--curvestyleall xxx
|
||||||
|
|
||||||
Additional styles for all curves that have no --curvestyle
|
Additional styles for all curves that have no --curvestyle. This is overridden
|
||||||
|
by any applicable C<--curvestyle>. Exclusive with C<--with>.
|
||||||
|
|
||||||
|
=item
|
||||||
|
|
||||||
|
--with xxx
|
||||||
|
|
||||||
|
Same as C<--curvestyleall>, but prefixed with "with". Thus
|
||||||
|
|
||||||
|
--with boxes
|
||||||
|
|
||||||
|
is equivalent to
|
||||||
|
|
||||||
|
--curvestyleall 'with boxes'
|
||||||
|
|
||||||
|
Exclusive with C<--curvestyleall>.
|
||||||
|
|
||||||
=item
|
=item
|
||||||
|
|
||||||
@ -1530,13 +1571,13 @@ replotted before being purged
|
|||||||
|
|
||||||
=item
|
=item
|
||||||
|
|
||||||
--extraValuesPerPoint
|
--extraValuesPerPoint xxx
|
||||||
|
|
||||||
xxx How many extra values are given for each data point. Normally this is 0, and
|
How many extra values are given for each data point. Normally this is 0, and
|
||||||
does not need to be specified, but sometimes we want extra data, like for colors
|
does not need to be specified, but sometimes we want extra data, like for colors
|
||||||
or point sizes or error bars, etc. feedgnuplot options that require this
|
or point sizes or error bars, etc. feedgnuplot options that require this
|
||||||
(colormap, circles) automatically set it. This option is ONLY needed if unknown
|
(colormap, circles) automatically set it. This option is ONLY needed if unknown
|
||||||
styles are used, with --curvestyleall for instance
|
styles are used, with C<--curvestyleall> or C<--with> for instance
|
||||||
|
|
||||||
=item
|
=item
|
||||||
|
|
||||||
@ -1609,7 +1650,7 @@ in a Thinkpad.
|
|||||||
=head2 Plotting a histogram of file sizes in a directory
|
=head2 Plotting a histogram of file sizes in a directory
|
||||||
|
|
||||||
$ ls -l | awk '{print $5/1e6}' |
|
$ ls -l | awk '{print $5/1e6}' |
|
||||||
feedgnuplot --histogram 0 --curvestyleall 'with boxes' --ymin 0 --xlabel 'File size (MB)' --ylabel Frequency
|
feedgnuplot --histogram 0 --with boxes --ymin 0 --xlabel 'File size (MB)' --ylabel Frequency
|
||||||
|
|
||||||
=head1 ACKNOWLEDGEMENT
|
=head1 ACKNOWLEDGEMENT
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ complete -W \
|
|||||||
--colormap \
|
--colormap \
|
||||||
--curvestyle \
|
--curvestyle \
|
||||||
--curvestyleall \
|
--curvestyleall \
|
||||||
|
--with \
|
||||||
--dataid \
|
--dataid \
|
||||||
--domain \
|
--domain \
|
||||||
--dump \
|
--dump \
|
||||||
|
@ -26,7 +26,8 @@ _arguments -S
|
|||||||
'--zmin:min Z:' \
|
'--zmin:min Z:' \
|
||||||
'--zmax:max Z:' \
|
'--zmax:max Z:' \
|
||||||
'*--y2:plot to place on the Y2 axis:' \
|
'*--y2:plot to place on the Y2 axis:' \
|
||||||
'--curvestyleall[Additional styles for ALL curves]:style' \
|
'(--with)--curvestyleall[Additional styles for ALL curves]:style' \
|
||||||
|
'(--curvestyleall)--with[Additional styles for ALL curves]:style' \
|
||||||
'*--extracmds[Additional gnuplot commands]:command' \
|
'*--extracmds[Additional gnuplot commands]:command' \
|
||||||
'*--set[Additional 'set' gnuplot commands]:set-option' \
|
'*--set[Additional 'set' gnuplot commands]:set-option' \
|
||||||
'*--unset[Additional 'unset' gnuplot commands]:unset-option' \
|
'*--unset[Additional 'unset' gnuplot commands]:unset-option' \
|
||||||
|
Loading…
Reference in New Issue
Block a user