mirror of
https://github.com/dkogan/feedgnuplot.git
synced 2025-05-05 22:11:12 +08:00
consolidated some logic. no-op clarification
This commit is contained in:
parent
0dd24c2cba
commit
83139d7ad0
@ -808,46 +808,23 @@ sub mainThread
|
|||||||
print(PIPE "set view equal xy\n");
|
print(PIPE "set view equal xy\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
# For the specified values, set the legend entries to 'title "blah blah"'
|
for my $what_options_prefix_suffix ( ['curvestyle', 'extraoptions', '', ' ' ],
|
||||||
if(@{$options{legend}})
|
['every', 'everyoptions', 'every ', ' ' ],
|
||||||
|
['legend', 'title', '', '' ])
|
||||||
{
|
{
|
||||||
# @{$options{legend}} is a list where consecutive pairs are (curveID,
|
my ($what, $options, $prefix, $suffix) = @$what_options_prefix_suffix;
|
||||||
# legend). I use $options{legend} here instead of $options{legend_hash}
|
|
||||||
# because I create a new curve when I see a new one, and the hash is
|
|
||||||
# unordered, thus messing up the ordering
|
|
||||||
my $n = scalar @{$options{legend}}/2;
|
|
||||||
foreach my $idx (0..$n-1)
|
|
||||||
{
|
|
||||||
addOption($options{legend}[$idx*2 ],
|
|
||||||
'title',
|
|
||||||
$options{legend}[$idx*2 + 1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# add the extra curve options
|
# @{$options{$what}} is a list where consecutive pairs are (curveID, style).
|
||||||
if(@{$options{curvestyle}})
|
if (@{$options{$what}})
|
||||||
{
|
{
|
||||||
# @{$options{curvestyle}} is a list where consecutive pairs are (curveID,
|
my $n = scalar @{$options{$what}}/2;
|
||||||
# style).
|
foreach my $idx (0..$n-1)
|
||||||
my $n = scalar @{$options{curvestyle}}/2;
|
{
|
||||||
foreach my $idx (0..$n-1)
|
addOption($options{$what}[$idx*2 ],
|
||||||
{
|
$options,
|
||||||
addOption($options{curvestyle}[$idx*2 ],
|
$prefix . $options{$what}[$idx*2 + 1] . $suffix);
|
||||||
'extraoptions',
|
}
|
||||||
$options{curvestyle}[$idx*2 + 1] . " ");
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
if(@{$options{every}})
|
|
||||||
{
|
|
||||||
# @{$options{every}} is a list where consecutive pairs are (curveID,
|
|
||||||
# every).
|
|
||||||
my $n = scalar @{$options{every}}/2;
|
|
||||||
foreach my $idx (0..$n-1)
|
|
||||||
{
|
|
||||||
addOption($options{every}[$idx*2 ],
|
|
||||||
'everyoptions',
|
|
||||||
"every " . $options{every}[$idx*2 + 1] . " ");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addOption($_, 'extraoptions', 'axes x1y2 ') foreach (@{$options{x1y2}});
|
addOption($_, 'extraoptions', 'axes x1y2 ') foreach (@{$options{x1y2}});
|
||||||
|
Loading…
Reference in New Issue
Block a user