--legend and --curvestyle cmdline options now reference specific curves

This commit is contained in:
Dima Kogan 2011-04-09 13:42:32 -07:00
parent 1e1d878d67
commit bcbfde1af1

View File

@ -121,8 +121,10 @@ As an example, if line 3 of the input is "0 9 1 20"
--title xxx Set the title of the plot --title xxx Set the title of the plot
--legend xxx Set the label for a curve plot. Give this option multiple --legend curveID=legend
times for multiple curves Set the label for a curve plot. Use this option multiple times
for multiple curves. With --dataid, curveID is the ID. Otherwise,
it's the index of the curve, starting at 0
--autolegend Use the curve IDs for the legend. Titles given with --legend --autolegend Use the curve IDs for the legend. Titles given with --legend
override these override these
@ -146,8 +148,10 @@ As an example, if line 3 of the input is "0 9 1 20"
Without --dataid, the ID is just an ordered 0-based index. Without --dataid, the ID is just an ordered 0-based index.
Does not apply to 3d plots. Does not apply to 3d plots.
--curvestyle xxx Additional style per curve. Give this option multiple --curvestyle curveID=style
times for multiple curves Additional styles per curve. With --dataid, curveID is the
ID. Otherwise, it's the index of the curve, starting at 0. Use
this option multiple times for multiple curves
--curvestyleall xxx Additional styles for ALL curves. --curvestyleall xxx Additional styles for ALL curves.
@ -207,9 +211,9 @@ OEF
$options{ maxcurves } = 100; $options{ maxcurves } = 100;
GetOptions($options, 'stream!', 'domain!', 'dataid!', '3d!', 'colormap!', 'lines!', 'points!', GetOptions($options, 'stream!', 'domain!', 'dataid!', '3d!', 'colormap!', 'lines!', 'points!',
'circles', 'legend=s@', 'autolegend!', 'xlabel=s', 'ylabel=s', 'y2label=s', 'zlabel=s', 'circles', 'legend=s%', 'autolegend!', 'xlabel=s', 'ylabel=s', 'y2label=s', 'zlabel=s',
'title=s', 'xlen=f', 'ymin=f', 'ymax=f', 'xmin=f', 'xmax=f', 'y2min=f', 'y2max=f', 'title=s', 'xlen=f', 'ymin=f', 'ymax=f', 'xmin=f', 'xmax=f', 'y2min=f', 'y2max=f',
'zmin=f', 'zmax=f', 'y2=s@', 'curvestyle=s@', 'curvestyleall=s', 'extracmds=s@', 'zmin=f', 'zmax=f', 'y2=s@', 'curvestyle=s%', 'curvestyleall=s', 'extracmds=s@',
'size=s', 'square!', 'square_xy!', 'hardcopy=s', 'maxcurves=i', 'monotonic!', 'size=s', 'square!', 'square_xy!', 'hardcopy=s', 'maxcurves=i', 'monotonic!',
'extraValuesPerPoint=i', 'help', 'dump') or die($usage); 'extraValuesPerPoint=i', 'help', 'dump') or die($usage);
@ -426,20 +430,18 @@ sub mainThread
# For the specified values, set the legend entries to 'title "blah blah"' # For the specified values, set the legend entries to 'title "blah blah"'
if($options{legend}) if($options{legend})
{ {
my $id = 0; foreach my $id (keys %{$options{legend}})
foreach (@{$options{legend}})
{ {
setCurveLabel($id++, $_); setCurveLabel($id, $options{legend}{$id});
} }
} }
# add the extra curve options # add the extra curve options
if($options{curvestyle}) if($options{curvestyle})
{ {
my $id = 0; foreach my $id (keys %{$options{curvestyle}})
foreach (@{$options{curvestyle}})
{ {
addCurveOption($id++, $_); addCurveOption($id, $options{curvestyle}{$id});
} }
} }
@ -701,7 +703,7 @@ Simple plotting of stored data:
10 25 10 25
$ seq 5 | awk '{print 2*$1, $1*$1}' | $ seq 5 | awk '{print 2*$1, $1*$1}' |
feedGnuplot --lines --points --legend "data 0" --title "Test plot" --y2 1 feedGnuplot --lines --points --legend 0="data 0" --title "Test plot" --y2 1
Simple real-time plotting example: plot how much data is received on the wlan0 Simple real-time plotting example: plot how much data is received on the wlan0
network interface in bytes/second (uses bash, awk and Linux): network interface in bytes/second (uses bash, awk and Linux):
@ -731,9 +733,9 @@ script. Anything not directly supported can still be done with the
C<--extracmds> and C<--curvestyle> options. Arbitrary gnuplot commands can be C<--extracmds> and C<--curvestyle> options. Arbitrary gnuplot commands can be
passed in with C<--extracmds>. For example, to turn off the grid, pass in passed in with C<--extracmds>. For example, to turn off the grid, pass in
C<--extracmds 'unset grid'>. As many of these options as needed can be passed C<--extracmds 'unset grid'>. As many of these options as needed can be passed
in. To add arbitrary curve styles, use C<--curvestyle extrastyle>. Pass these in. To add arbitrary curve styles, use C<--curvestyle curveID=extrastyle>. Pass
more than once to affect more than one curve. To apply an extra style to I<all> these more than once to affect more than one curve. To apply an extra style to
the curves, pass in C<--curvestyleall extrastyle>. I<all> the curves, pass in C<--curvestyleall extrastyle>.
=head2 Data formats =head2 Data formats