From 1252315598b6594c470da139f0ba47372d3dfd92 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Fri, 18 Oct 2013 13:38:52 -0700 Subject: [PATCH 01/23] tweaked a recipe to use --timefmt --- bin/feedgnuplot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index f7c8dee..cbeb80a 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -1518,13 +1518,13 @@ Looks at wlan0 on Linux. gawk '/wlan0/ {if(b) {print $2-b; fflush()} b=$2}' | feedgnuplot --lines --stream --xlen 10 --ylabel 'Bytes/sec' --xlabel seconds -=head2 Realtime plot of battery charge +=head2 Realtime plot of battery charge in respect to time Uses the result of the C command. $ while true; do acpi; sleep 15; done | - perl -nE 'BEGIN{ $| = 1; } /([0-9]*)%/; say join(" ", $./4, $1);' | - feedgnuplot --stream --ymin 0 --ymax 100 --domain --xlabel 'Time (seconds)' --ylabel "Battery charge (%)" + perl -nE 'BEGIN{ $| = 1; } /([0-9]*)%/; say join(" ", time(), $1);' | + feedgnuplot --stream --ymin 0 --ymax 100 --lines --domain --xlabel 'Time' --timefmt '%s' --ylabel "Battery charge (%)" =head2 Realtime plot of temperatures in an IBM Thinkpad From 1acb30c3cd13f681e6697f741b58ec8c1e96d236 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Fri, 18 Oct 2013 15:17:47 -0700 Subject: [PATCH 02/23] first (very early) cut at a functional testing script --- MANIFEST | 1 + t/plots.t | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 t/plots.t diff --git a/MANIFEST b/MANIFEST index 7a47fbf..c2ff39a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3,5 +3,6 @@ MANIFEST bin/feedgnuplot t/00-load.t t/manifest.t +t/plots.t Changes LICENSE diff --git a/t/plots.t b/t/plots.t new file mode 100644 index 0000000..e510306 --- /dev/null +++ b/t/plots.t @@ -0,0 +1,88 @@ +#!/usr/bin/perl + +# require a threaded perl for my tests. This block lifted verbatim from the cpantesters wiki +BEGIN { + use Config; + if (! $Config{'useithreads'}) { + print("1..0 # Skip: Perl not compiled with 'useithreads'\n"); + exit(0); + } +} + +use Test::More tests => 1; +use Test::Script::Run 'is_script_output'; +use File::Temp 'tempfile'; + + +tryplot( [], 'seq 5', <<'EOF' ); + + + 5 ++--+---+--+---+---+---+--+--+A + + + + + + + + + *+ + | * | + | * | + 4.5 ++ * ++ + | * | + | * | + | * | + | * | + 4 ++ A ++ + | * | + | * | + | * | + 3.5 ++ * ++ + | * | + | * | + | * | + 3 ++ A ++ + | * | + | * | + | * | + | * | + 2.5 ++ * ++ + | * | + | * | + | * | + 2 ++ A ++ + | * | + | * | + | * | + | * | + 1.5 ++ * ++ + | * | + | * | + +* + + + + + + + + + 1 A+--+---+--+---+---+---+--+--++ + 1 1.5 2 2.5 3 3.5 4 4.5 5 + +EOF + + + + + + + +sub tryplot +{ + my $extraoptions = shift; + my $incmd = shift; + my $ref = shift; + + my ($fh, $input_filename) = tempfile( UNLINK => 1); + open IN, '-|', $incmd; + print $fh ; + close IN; + close $fh; + + my @options = (qw(--lines --points --exit), + '--extracmds', 'unset grid', + '--terminal', 'dumb 40,40', + $input_filename); + + unshift @options, @$extraoptions; + + is_script_output( 'feedgnuplot', \@options, + [$ref =~ /(.*)\n/g], [], + 'basic line plot'); +} From faaeac7990d4991003708c1f9efd3e50fb536498 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 14:00:12 -0700 Subject: [PATCH 03/23] made POD less verbose --- bin/feedgnuplot | 54 +++++++------------------------------------------ 1 file changed, 7 insertions(+), 47 deletions(-) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index cbeb80a..1958fb8 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -1274,7 +1274,7 @@ Set y-axis label. Only applies to 3d plots =item ---title xxx +--title xxx Set the title of the plot @@ -1302,55 +1302,15 @@ to 0 to plot ALL the data. Does not make sense with 3d plots. Implies =item ---xmin xxx +--xmin/xmax/ymin/ymax/y2min/y2max/zmin/zmax xxx -Set the range for the x axis. These are ignored in a streaming plot +Set the range for the given axis. These x-axis bounds are ignored in a streaming +plot. The y2-axis bound do not apply in 3d plots. The z-axis bounds apply +I to 3d plots or colormaps. =item ---xmax xxx - -Set the range for the x axis. These are ignored in a streaming plot - -=item - ---ymin xxx - -Set the range for the y axis. - -=item - ---ymax xxx - -Set the range for the y axis. - -=item - ---y2min xxx - -Set the range for the y2 axis. Does not apply to 3d plots. - -=item - ---y2max xxx - -Set the range for the y2 axis. Does not apply to 3d plots. - -=item - ---zmin xxx - -Set the range for the z axis. Only applies to 3d plots or colormaps. - -=item - ---zmax xxx - -Set the range for the z axis. Only applies to 3d plots or colormaps. - -=item - ---y2 xxx +--y2 xxx Plot the data specified by this curve ID on the y2 axis. Without --dataid, the ID is just an ordered 0-based index. Does not apply to 3d plots. Can be passed @@ -1358,7 +1318,7 @@ multiple times, or passed a comma-separated list =item ---histogram curveID +--histogram curveID Set up a this specific curve to plot a histogram. The bin width is given with From acd6de507c4549ddaaf3577496071b1608865f92 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 14:26:30 -0700 Subject: [PATCH 04/23] fixed doc reformatting typo --- bin/feedgnuplot | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index 1958fb8..5b0ce26 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -1250,39 +1250,15 @@ Automatically increments extraValuesPerPoint =item ---xlabel xxx - -Set x-axis label - -=item - ---ylabel xxx - -Set y-axis label - -=item - ---y2label xxx - -Set y2-axis label. Does not apply to 3d plots - -=item - ---zlabel xxx - -Set y-axis label. Only applies to 3d plots - -=item - --title xxx Set the title of the plot =item ---legend curveID lege +--legend curveID legend -nd Set the label for a curve plot. Use this option multiple times for multiple +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 @@ -1306,7 +1282,14 @@ to 0 to plot ALL the data. Does not make sense with 3d plots. Implies Set the range for the given axis. These x-axis bounds are ignored in a streaming plot. The y2-axis bound do not apply in 3d plots. The z-axis bounds apply -I to 3d plots or colormaps. +I to 3d plots or colormaps. + +=item + +--xlabel/ylabel/y2label/zlabel xxx + +Label the given axis. The y2-axis label does not apply to 3d plots while the +z-axis label applies I to 3d plots. =item From f4976bd0f700fd2d745a201b81835b544188ac5f Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 15:33:30 -0700 Subject: [PATCH 05/23] --circles explicitly not supported for 3d plots --- bin/feedgnuplot | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index 5b0ce26..c89315e 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -245,6 +245,12 @@ sub interpretCommandline print STDERR "--3d does not make sense with histograms\n"; exit -1; } + + if ( defined $options{circles} ) + { + print STDERR "--3d does not make sense with circles (gnuplot doesn't support this)\n"; + exit -1; + } } else { @@ -1218,7 +1224,7 @@ Interpret the X data as a time/date, parsed with the given format Show a colormapped xy plot. Requires extra data for the color. zmin/zmax can be used to set the extents of the colors. Automatically increments -extraValuesPerPoint +C<--extraValuesPerPoint> =item @@ -1246,7 +1252,8 @@ Do [not] draw points --circles Plot with circles. This requires a radius be specified for each point. -Automatically increments extraValuesPerPoint +Automatically increments C<--extraValuesPerPoint). C supported for 3d +plots. =item From 99369d1542d281502ef5571595e7bc308c50e7d5 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 16:08:13 -0700 Subject: [PATCH 06/23] y2-axis curves no longer have a thicker line by default This was causing an issue where gnuplot would complain if a points-only --curvestyle was plotted on the y2 axis. This is because --linewidth makes no sense for a points-only curve --- bin/feedgnuplot | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index c89315e..3fe20e9 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -499,7 +499,7 @@ sub mainThread { foreach (@{$options{y2}}) { - addCurveOption($_, 'axes x1y2 linewidth 3'); + addCurveOption($_, 'axes x1y2'); } } @@ -1304,7 +1304,14 @@ z-axis label applies I to 3d plots. Plot the data specified by this curve ID on the y2 axis. Without --dataid, the ID is just an ordered 0-based index. Does not apply to 3d plots. Can be passed -multiple times, or passed a comma-separated list +multiple times, or passed a comma-separated list. By default the y2-axis curves +look the same as the y-axis ones. I.e. the viewer of the resulting plot has to +be told which is which via an axes label, legend, etc. Prior to version 1.25 of +feedgnuplot the curves plotted on the y2 axis were drawn with a thicker line. +This is no longer the case, but that behavior can be brought back by passing +something like + + --y2 curveid --curvestyle curveid 'linewidth 3' =item From deaa85dbd3f518cd0fb15cd356afa634bb546502 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 01:01:59 -0700 Subject: [PATCH 07/23] expanded test suite --- t/plots.t | 729 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 718 insertions(+), 11 deletions(-) diff --git a/t/plots.t b/t/plots.t index e510306..907a919 100644 --- a/t/plots.t +++ b/t/plots.t @@ -1,5 +1,11 @@ #!/usr/bin/perl +# This tests various features of feedgnuplot. Note that the tests look at actual +# plot output using the 'dumb' terminal, so any changes in gnuplot itself that +# change the way the output looks will show up as test failures. Hopefully this +# will not be a big deal + + # require a threaded perl for my tests. This block lifted verbatim from the cpantesters wiki BEGIN { use Config; @@ -9,12 +15,14 @@ BEGIN { } } -use Test::More tests => 1; +use Test::More tests => 16; use Test::Script::Run 'is_script_output'; use File::Temp 'tempfile'; - -tryplot( [], 'seq 5', <<'EOF' ); +tryplot( testname => 'basic line plot', + cmd => 'seq 5', + options => [qw(--lines --points)], + refplot => <<'EOF' ); 5 ++--+---+--+---+---+---+--+--+A @@ -57,32 +65,731 @@ tryplot( [], 'seq 5', <<'EOF' ); EOF +tryplot( testname => 'basic lines-only plot', + cmd => 'seq 5', + options => [qw(--lines)], + refplot => <<'EOF' ); + + + 5 ++--+---+--+---+---+---+--+--+* + + + + + + + + + *+ + | * | + | * | + 4.5 ++ * ++ + | * | + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + 3.5 ++ * ++ + | * | + | * | + | * | + 3 ++ * ++ + | * | + | * | + | * | + | * | + 2.5 ++ * ++ + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + 1.5 ++ * ++ + | * | + | * | + +* + + + + + + + + + 1 *+--+---+--+---+---+---+--+--++ + 1 1.5 2 2.5 3 3.5 4 4.5 5 + +EOF + +tryplot( testname => 'basic points-only plot', + cmd => 'seq 5', + options => [qw(--points)], + refplot => <<'EOF' ); + + + 5 ++--+---+--+---+---+---+--+--+A + + + + + + + + + + + | | + | | + 4.5 ++ ++ + | | + | | + | | + | | + 4 ++ A ++ + | | + | | + | | + 3.5 ++ ++ + | | + | | + | | + 3 ++ A ++ + | | + | | + | | + | | + 2.5 ++ ++ + | | + | | + | | + 2 ++ A ++ + | | + | | + | | + | | + 1.5 ++ ++ + | | + | | + + + + + + + + + + + 1 A+--+---+--+---+---+---+--+--++ + 1 1.5 2 2.5 3 3.5 4 4.5 5 + +EOF + +tryplot( testname => 'basic line plot with bounds', + cmd => 'seq 5', + options => [qw(--lines --points), + qw(--xmin -10.5 --xmax 4.5 --ymin -0.5 --ymax 5.5)], + refplot => <<'EOF' ); + + + ++---+----+---+---+---+----+---++ + |+ + + + + + + +| + | | + 5 ++ ++ + | | + | | + | * + | * + | *| + 4 ++ A+ + | *| + | * | + | * | + | * | + | * | + 3 ++ A ++ + | * | + | * | + | * | + | * | + 2 ++ A ++ + | * | + | * | + | * | + | * | + | * | + 1 ++ A ++ + | | + | | + | | + | | + | | + 0 ++ ++ + | | + |+ + + + + + + +| + ++---+----+---+---+---+----+---++ + -10 -8 -6 -4 -2 0 2 4 + +EOF + +tryplot( testname => 'basic line plot with bounds, square aspect ratio', + cmd => 'seq 5', + options => [qw(--lines --points), + qw(--xmin -10.5 --xmax 4.5 --ymin -0.5 --ymax 5.5 --square)], + refplot => <<'EOF' ); + + + + + + + + ++---+----+---+---+---+----+---++ + 5 ++ + + + + + + ++ + | * + 4 ++ A+ + | * | + 3 ++ A ++ + | * | + | * | + 2 ++ A ++ + | * | + 1 ++ A ++ + | | + 0 ++ + + + + + + ++ + ++---+----+---+---+---+----+---++ + -10 -8 -6 -4 -2 0 2 4 + + + + + + + + + + + + +EOF + +tryplot( testname => 'lines on both axes with labels, legends, titles', + cmd => q{seq 5 | awk '{print 2*$1, $1*$1}'}, + options => [qw(--lines --points), + '--legend', '0', 'data 0', + '--title', "Test plot", + qw(--y2 1 --y2label y2 --xlabel x --ylabel y --y2max 30)], + refplot => <<'EOF' ); + + Test plot + y2 + 10 ++-+---+--+--+--+---+--+-+A 30 + + + + + + + + + *+ + | data 0 **A****| + | * | + 9 ++ * | + | * +B 25 + | * #| + | * #| + 8 ++ A # | + | * # | + | * # | + | * # ++ 20 + 7 ++ * # | + | * # | + | * # | + | * B | + 6 ++ A # ++ 15 + | * # | + | * # | + | * # | + | * # | + 5 ++ * # | + | * # ++ 10 + | * B | + | * # | + 4 ++ A # | + | * # | + | * # ++ 5 + | * # | + 3 ++ * #B | + | *## | + | *# | + B* + + + + + + + + + 2 A+-+---+--+--+--+---+--+-++ 0 + 1 1.5 2 2.5 3 3.5 4 4.5 5 + x + +EOF + +tryplot( testname => 'lines on both axes with labels, legends, titles; different styles', + cmd => q{seq 5 | awk '{print 2*$1, $1*$1}'}, + options => ['--legend', '0', 'data 0', + '--title', "Test plot", + qw(--y2 1 --y2label y2 --xlabel x --ylabel y --y2max 30), + '--curvestyle', '0', 'with lines', + '--curvestyle', '1', 'with points ps 3 pt 7'], + refplot => <<'EOF' ); + + Test plot + y2 + 10 ++-+---+--+--+--+---+--+-+* 30 + + + + + + + + + *+ + | data 0 *******| + | * | + 9 ++ * | + | * +G 25 + | * | + | * | + 8 ++ * | + | * | + | * | + | * ++ 20 + 7 ++ * | + | * | + | * | + | * G | + 6 ++ * ++ 15 + | * | + | * | + | * | + | * | + 5 ++ * | + | * ++ 10 + | * G | + | * | + 4 ++ * | + | * | + | * ++ 5 + | * | + 3 ++ * G | + | * | + | * | + G* + + + + + + + + + 2 *+-+---+--+--+--+---+--+-++ 0 + 1 1.5 2 2.5 3 3.5 4 4.5 5 + x + +EOF + +tryplot( testname => 'domain plot', + cmd => q{seq 5 | awk '{print 2*$1, $1*$1}'}, + options => [qw(--lines --points), '--domain'], + refplot => <<'EOF' ); + + + 25 ++--+---+---+---+--+---+---+--+A + + + + + + + + + *+ + | *| + | * | + | * | + | * | + | * | + 20 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | A | + 15 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 10 ++ * ++ + | A | + | * | + | * | + | ** | + | * | + | * | + 5 ++ * ++ + | A | + | ** | + | ** | + | * | + |** | + A + + + + + + + + + 0 ++--+---+---+---+--+---+---+--++ + 2 3 4 5 6 7 8 9 10 + +EOF + +tryplot( testname => 'dataid plot', + cmd => q{seq 5 | awk '{print 2*$1, $1*$1}'}, + options => [qw(--lines --points), + qw(--dataid --autolegend)], + refplot => <<'EOF' ); + + + 25 ++--+---+---+---+--+---+---+--+E + + + + + + + + + + + | 2 **A*** | + | 4 ##B### | + | 6 $$C$$$ | + | 8 %%D%%% | + | 10 @@E@@@ | + 20 ++ ++ + | | + | | + | | + | | + | | + | D | + 15 ++ ++ + | | + | | + | | + | | + | | + | | + 10 ++ ++ + | C | + | | + | | + | | + | | + | | + 5 ++ ++ + | B | + | | + | | + | | + | | + A + + + + + + + + + 0 ++--+---+---+---+--+---+---+--++ + 1 1.5 2 2.5 3 3.5 4 4.5 5 + +EOF + +tryplot( testname => '3d spiral with bounds, labels', + cmd => q{seq 50 | awk '{print 2*cos($1/5), sin($1/5), $1}'}, + options => [qw(--lines --points), + qw(--3d --domain --zmin -5 --zmax 45 --zlabel z), + '--extracmds', 'set view 60,30'], + refplot => <<'EOF' ); + + + + + + + + A*AA*AA* + * A* + AA + A + A + * + + A + 40 |+ A*A*AAA* A + | A A*A* A + 30 |+ AA A A + | A A + z 20 |+ AA A A + | AA*AA*A*AA*A*A A + 10 |+ +- A + | -+ --- A + 0 |+ -+ + --- + | -+ +--- + | --+ + --- + | -++ +- 1 + | -+ 0.8 + |-+ 0.6 + ++--- - 0.4 + -21.5 +--- -+ 0.2 + -1+ + +-- +-0.2 + -0.50+ +--- +-0.4 + 0.51++-+-0.6 + 1.5+-1.8 + 2 + + + + + +EOF + +tryplot( testname => '3d spiral with bounds, labels, square xy aspect ratio', + cmd => q{seq 50 | awk '{print 2*cos($1/5), sin($1/5), $1}'}, + options => [qw(--lines --points), + qw(--3d --domain --zmin -5 --zmax 45 --zlabel z), + '--extracmds', 'set view 60,30', '--square_xy'], + refplot => <<'EOF' ); + + + + + + + + + *AA* + AA*A + A + + A*A + 40 |+ A + | A + 30 |+ A + | AAAAA* A + z 20 |+AA AA A + | AA* A*A AA + | AA*AAA*AA*A + 10 |+ AAA + 0 |+ A + | A + | +- A + | -++--- + | --+ +--- + |-++ +--- + +++-- --- + -21.5+--- +- 1 + -10.5--- + 0.6 + 0 +--- + 024 + 0.5 ++-0.4 + 1.521.8 + + + + + + + + +EOF + +tryplot( testname => 'Histogram plot', + cmd => q{seq 50 | awk '{print $1*$1}'}, + options => [qw(--lines --points), + qw(--histo 0 --binwidth 50 --ymin 0 --curvestyleall), 'with boxes'], + refplot => <<'EOF' ); + + + 4 ++--**---+---+---+---+----+--++ + + ** + + + + + + + | ** | + | ** | + 3.5 ++ ** ++ + | ** | + | ** | + | ** | + | ** | + 3 ++ ** ++ + | ** | + | ** | + | ** | + 2.5 ++ ** ++ + | ** | + | ** | + | ** | + 2 ++ **** ++ + | **** | + | **** | + | **** | + | **** | + 1.5 ++ **** ++ + | **** | + | **** | + | **** | + 1 ++ *********************** ++ + | *********************** | + | *********************** | + | *********************** | + | *********************** | + 0.5 ++ *********************** ++ + | *********************** | + | *********************** | + + *********************** + + 0 ++--***********************--++ + -500 0 500 100015002000 25003000 + +EOF + +tryplot( testname => 'Cumulative histogram', + cmd => q{seq 50 | awk '{print $1*$1}'}, + options => [qw(--lines --points), + qw(--histo 0 --histstyle cum --binwidth 50 --ymin 0 --curvestyleall), 'with boxes'], + refplot => <<'EOF' ); + + + 50 ++--+----+---+----+---+---**--++ + + + + + + + *** + + | **** | + | ****** | + | ******* | + | ******* | + | ********* | + 40 ++ ********** ++ + | *********** | + | ************ | + | ************* | + | ************** | + | ************** | + | *************** | + 30 ++ **************** ++ + | ***************** | + | ***************** | + | ****************** | + | ****************** | + | ******************* | + | ******************** | + 20 ++ ******************** ++ + | ********************* | + | ********************* | + | ********************** | + | ********************** | + | ********************** | + | *********************** | + 10 ++ *********************** ++ + | *********************** | + | *********************** | + | *********************** | + | ************************ | + | ************************ | + + ************************ + + 0 ++--************************--++ + -500 0 500 1000 15002000 25003000 + +EOF + +tryplot( testname => 'Circles', + cmd => q{seq 5 | awk '{print $1,$1,$1/10}'}, + options => [qw(--circles --domain)], + refplot => <<'EOF' ); + + + 5 ++-+--+--+--+--+--+--+--*--+-** + + + + + + + + + * + *+ + | * *| + | ******| + 4.5 ++ ++ + | | + | | + | * | + | **** | + 4 ++ * ** ++ + | * * | + | **** | + | | + 3.5 ++ ++ + | | + | * | + | **** | + 3 ++ * ** ++ + | * * | + | **** | + | | + | | + 2.5 ++ ++ + | | + | | + | * | + 2 ++ *** ++ + | ** | + | | + | | + | | + 1.5 ++ ++ + | | + | | + + * + + + + + + + + + + 1 ++***-+--+--+--+--+--+--+--+-++ + 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 + +EOF + +tryplot( testname => 'Error bars (using extraValuesPerPoint)', + cmd => q{seq 5 | awk '{print $1,$1,$1/10}'}, + options => [qw(--domain), + qw(--extraValuesPerPoint 1 --curvestyle 0), 'with errorbars'], + refplot => <<'EOF' ); + + + 5.5 ++--+---+--+---+---+---+--+--*** + + + + + + + + + * + | * + 5 ++ +A + | * + | * + | * + 4.5 ++ *** + | *** | + | * | + 4 ++ A ++ + | * | + | * | + | *** | + 3.5 ++ ++ + | *** | + | * | + 3 ++ A ++ + | * | + | * | + | *** | + 2.5 ++ ++ + | | + | *** | + 2 ++ A ++ + | * | + | *** | + | | + 1.5 ++ ++ + | | + | | + 1*A* ++ + *** | + | | + + + + + + + + + + + 0.5 ++--+---+--+---+---+---+--+--++ + 1 1.5 2 2.5 3 3.5 4 4.5 5 + +EOF + +tryplot( testname => 'Monotonicity check', + cmd => q{seq 10 | awk '{print (NR-1)%5,NR}'}, + options => [qw(--lines --points --domain --monotonic)], + refplot => <<'EOF' ); + + + 10 ++--+---+--+---+---+---+--+--+A + + + + + + + + + *+ + | * | + | * | + 9.5 ++ * ++ + | * | + | * | + | * | + | * | + 9 ++ A ++ + | * | + | * | + | * | + 8.5 ++ * ++ + | * | + | * | + | * | + 8 ++ A ++ + | * | + | * | + | * | + | * | + 7.5 ++ * ++ + | * | + | * | + | * | + 7 ++ A ++ + | * | + | * | + | * | + | * | + 6.5 ++ * ++ + | * | + | * | + +* + + + + + + + + + 6 A+--+---+--+---+---+---+--+--++ + 0 0.5 1 1.5 2 2.5 3 3.5 4 + +EOF + sub tryplot { - my $extraoptions = shift; - my $incmd = shift; - my $ref = shift; + my %args = @_; my ($fh, $input_filename) = tempfile( UNLINK => 1); - open IN, '-|', $incmd; + open IN, '-|', $args{cmd}; print $fh ; close IN; close $fh; - my @options = (qw(--lines --points --exit), + my @options = ('--exit', '--extracmds', 'unset grid', '--terminal', 'dumb 40,40', $input_filename); - unshift @options, @$extraoptions; + unshift @options, @{$args{options}}; is_script_output( 'feedgnuplot', \@options, - [$ref =~ /(.*)\n/g], [], - 'basic line plot'); + [$args{refplot} =~ /(.*)\n/g], [], + $args{testname}); } From 669fb8dee68bdd8374fe81d14a90f0b5f57879c9 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 19:01:59 -0700 Subject: [PATCH 08/23] '--stream --hardcopy' is now an error, not a warning --- bin/feedgnuplot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index 3fe20e9..3ac770a 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -163,8 +163,8 @@ sub interpretCommandline if ( defined $options{hardcopy} && defined $options{stream} ) { - print STDERR "Warning: since we're making a hardcopy, I'm disabling streaming\n"; - delete $options{stream}; + print STDERR "--stream doesn't make sense together with --hardcopy\n"; + exit -1; } # parse stream option. Allowed only numbers >= 0 or 'trigger'. After this code From ffd19b9b873af6c9a55dcea8e32593fca1a7e68a Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 19:24:57 -0700 Subject: [PATCH 09/23] --hardcopy now handles piped output If we tell gnuplot to plot to a file whose name starts with '|', gnuplot writes to a a process, not to a file. This is now supported by feedgnuplot --- bin/feedgnuplot | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index 3ac770a..a08da26 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -406,11 +406,15 @@ sub mainThread my $outputfile; my $outputfileType; - if( $options{hardcopy}) + if( defined $options{hardcopy}) { $outputfile = $options{hardcopy}; - $outputfile =~ /\.(eps|ps|pdf|png|svg)$/i; - $outputfileType = $1 ? lc $1 : ''; + if( $outputfile =~ /^[^|] # starts with anything other than | + .* # stuff in the middle + \.(eps|ps|pdf|png|svg)$/ix) # ends with a known extension + { + $outputfileType = lc $1; + } my %terminalOpts = ( eps => 'postscript solid color enhanced eps', @@ -419,8 +423,12 @@ sub mainThread png => 'png size 1280,1024', svg => 'svg'); - $options{terminal} ||= $terminalOpts{$outputfileType} - if $terminalOpts{$outputfileType}; + if( !defined $options{terminal} && + defined $outputfileType && + $terminalOpts{$outputfileType} ) + { + $options{terminal} = $terminalOpts{$outputfileType}; + } die "Asked to plot to file '$outputfile', but I don't know which terminal to use, and no --terminal given" unless $options{terminal}; @@ -658,13 +666,20 @@ sub mainThread # finished reading in all. Plot what we have plotStoredData(); - if ( $options{hardcopy}) + if ( defined $options{hardcopy}) { print PIPE "set output\n"; - # sleep until the plot file exists, and it is closed. Sometimes the output is - # still being written at this point - usleep(100_000) until -e $outputfile; - usleep(100_000) until(system("fuser -s \"$outputfile\"")); + + # sleep until the plot file exists, and it is closed. Sometimes the output + # is still being written at this point. If the output filename starts with + # '|', gnuplot pipes the output to that process, instead of writing to a + # file. In that case I don't make sure the file exists, since there IS not + # file + if( $options{hardcopy} !~ /^\|/ ) + { + usleep(100_000) until -e $outputfile; + usleep(100_000) until(system("fuser -s \"$outputfile\"")); + } print "Wrote output to $outputfile\n"; return; From f2fa0bf14cd8422b3e935a913febe52190c45948 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 19:44:59 -0700 Subject: [PATCH 10/23] added --hardcopy tests --- t/plots.t | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/t/plots.t b/t/plots.t index 907a919..a5e26fe 100644 --- a/t/plots.t +++ b/t/plots.t @@ -65,6 +65,54 @@ tryplot( testname => 'basic line plot', EOF +tryplot( testname => 'basic line plot to piped hardcopy', + cmd => 'seq 5', + options => [qw(--lines --points), + '--hardcopy', '|cat'], + refplot => <<'EOF' ); + + + 5 ++--+---+--+---+---+---+--+--+A + + + + + + + + + *+ + | * | + | * | + 4.5 ++ * ++ + | * | + | * | + | * | + | * | + 4 ++ A ++ + | * | + | * | + | * | + 3.5 ++ * ++ + | * | + | * | + | * | + 3 ++ A ++ + | * | + | * | + | * | + | * | + 2.5 ++ * ++ + | * | + | * | + | * | + 2 ++ A ++ + | * | + | * | + | * | + | * | + 1.5 ++ * ++ + | * | + | * | + +* + + + + + + + + + 1 A+--+---+--+---+---+---+--+--++ + 1 1.5 2 2.5 3 3.5 4 4.5 5 + +Wrote output to |cat +EOF + tryplot( testname => 'basic lines-only plot', cmd => 'seq 5', options => [qw(--lines)], From 0863998848862fc4db4d2ad5f25e375c403084cd Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 20:27:56 -0700 Subject: [PATCH 11/23] streaming data now has an 'exit' command --- bin/feedgnuplot | 73 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 18 deletions(-) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index a08da26..a6441af 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -59,6 +59,8 @@ if($options{stream}) { chomp; + last if /^exit/; + # place every line of input to the queue, so that the plotting thread can process it. if we are # using an implicit domain (x = line number), then we send it on the data queue also, since # $. is not meaningful in the plotting thread @@ -588,15 +590,25 @@ sub mainThread { next if /^#/o; - if( $options{stream} && /^clear/o ) - { clearCurves(); } - - elsif( $options{stream} && /^replot/o ) + if( $options{stream} ) { - # /timertick/ determines if the timer was the source of the replot - replot( $domain0_numeric, /timertick/ ); + if(/^clear/o ) + { + clearCurves(); + next; + } + + if(/^replot/o ) + { + # /timertick/ determines if the timer was the source of the replot + replot( $domain0_numeric, /timertick/ ); + next; + } + + # /exit/ is handled in the data-reading thread } - elsif(! /^replot/o) + + if(! /^replot/o) { # parse the incoming data lines. The format is # x id0 dat0 id1 dat1 .... @@ -663,6 +675,12 @@ sub mainThread } } + # if we were streaming, we're now done! + if( $options{stream} ) + { + return; + } + # finished reading in all. Plot what we have plotStoredData(); @@ -1029,14 +1047,6 @@ instead of I as a function of I). Thus the first 2 values on each line are interpreted as the domain instead of just 1. The rest of the processing happens the same way as before. -=head3 Special data commands - -Other than the raw data, 2 special commands are interpreted if they appear in -the input. These are C and C. If a line of data begins with -C and we're plotting in realtime with C<--stream>, the plot will be -refreshed immediately. If a line of data begins with C, the plot is -cleared, to be re-filled with any data following the C. - =head3 Time/date data If the input data domain is a time/date, this can be interpreted with @@ -1081,7 +1091,8 @@ C seconds. If the period isn't specified, a 1Hz refresh rate is used. To refresh at specific intervals indicated by the data, set the refreshperiod to 0 or to 'trigger'. The plot will then I be refreshed when a data line 'replot' is received. This 'replot' command works in both triggered -and timed modes, but in triggered mode, it's the only way to replot. +and timed modes, but in triggered mode, it's the only way to replot. Look in +L for more information. To plot only the most recent data (instead of I the data), C<--xlen windowsize> can be given. This will create an constantly-updating, scrolling @@ -1090,6 +1101,32 @@ of the domain window to plot, in domain units (passed-in values if C<--domain> or line numbers otherwise). If the domain is a time/date via C<--timefmt>, then C is in seconds. +=head3 Special data commands + +If we are reading streaming data, the input stream can contain special commands +in addition to the raw data. Feedgnuplot looks for these at the start of every +input line. If a command is detected, the rest of the line is discarded. These +commands are + +=over + +=item C + +This command refreshes the plot right now, instead of waiting for the next +refresh time indicated by the timer. This command works in addition to the timed +refresh, as indicated by C<--stream [refreshperiod]>. + +=item C + +This command clears out the current data in the plot. The plotting process +continues, however, to any data following the C. + +=item C + +This command causes feedgnuplot to exit. + +=back + =head2 Hardcopy output The script is able to produce hardcopy output with C<--hardcopy outputfile>. The @@ -1247,8 +1284,8 @@ C<--extraValuesPerPoint> Plot the data as it comes in, in realtime. If period is given, replot every period seconds. If no period is given, replot at 1Hz. If the period is given as -0 or 'trigger', replot ONLY when the incoming data dictates this. See the -"Real-time streaming data" section of the man page. +0 or 'trigger', replot I when the incoming data dictates this. See the +L section of the man page. =item From 59625675f7ea2c0e3c7b9e15146740a3c271e6a4 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 21:31:23 -0700 Subject: [PATCH 12/23] test now uses IPC::Run directly instead of Test::Script::Run This is required for the streaming tests I'm about to write. Test::Script::Run doesn't know how to feed input from one process to another as the data comes in --- t/plots.t | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/t/plots.t b/t/plots.t index a5e26fe..63c8826 100644 --- a/t/plots.t +++ b/t/plots.t @@ -15,9 +15,11 @@ BEGIN { } } -use Test::More tests => 16; -use Test::Script::Run 'is_script_output'; +use Test::More tests => 32; use File::Temp 'tempfile'; +use IPC::Run 'run'; +use String::ShellQuote; +use File::Basename; tryplot( testname => 'basic line plot', cmd => 'seq 5', @@ -820,24 +822,28 @@ tryplot( testname => 'Monotonicity check', EOF + + + + sub tryplot { my %args = @_; - my ($fh, $input_filename) = tempfile( UNLINK => 1); - open IN, '-|', $args{cmd}; - print $fh ; - close IN; - close $fh; - my @options = ('--exit', '--extracmds', 'unset grid', - '--terminal', 'dumb 40,40', - $input_filename); + '--terminal', 'dumb 40,40'); unshift @options, @{$args{options}}; - is_script_output( 'feedgnuplot', \@options, - [$args{refplot} =~ /(.*)\n/g], [], - $args{testname}); + my $out = ''; + my $err = ''; + open IN, '-|', $args{cmd} or die "Couldn't open pipe to $args{cmd}"; + run [dirname($0) . "/../bin/feedgnuplot",, @options], + \*IN, \$out, \$err; + + note( "Running test '$args{testname}'. Running: $args{cmd} | feedgnuplot " . + shell_quote(@options)); + is($err, '', "$args{testname} stderr" ); + is($out, $args{refplot}, "$args{testname} stdout"); } From f83d8db27ac9e7adc89c47beaf475233abc7e58e Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 22:34:03 -0700 Subject: [PATCH 13/23] added streaming tests --- t/plots.t | 673 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 672 insertions(+), 1 deletion(-) diff --git a/t/plots.t b/t/plots.t index 63c8826..cd1b690 100644 --- a/t/plots.t +++ b/t/plots.t @@ -15,7 +15,7 @@ BEGIN { } } -use Test::More tests => 32; +use Test::More tests => 42; use File::Temp 'tempfile'; use IPC::Run 'run'; use String::ShellQuote; @@ -823,6 +823,677 @@ tryplot( testname => 'Monotonicity check', EOF +note( "Starting to run streaming tests. These will take several seconds each" ); + +# replotting every 1.0 seconds. Data comes in every 1.1 seconds. Two data +# points, and then "exit", so I should have two frames worth of data plotted. I +# pre-send a 0 so that the gnuplot autoscaling is always well-defined +tryplot( testname => 'basic streaming test', + cmd => q{seq 500 | awk 'BEGIN{ print 0; } {print (NR==3)? "exit" : $0; fflush(); system("sleep 1.1");}'}, + options => [qw(--lines --points --stream)], + refplot => <<'EOF' ); + + + 1 ++----+-----+-----+-----+----+A + + + + + + *+ + | * | + | * | + | * | + | * | + | * | + 0.8 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 0.6 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 0.4 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 0.2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + +* + + + + + + 0 A+----+-----+-----+-----+----++ + 1 1.2 1.4 1.6 1.8 2 + + + + 2 ++------+------+-------+-----+A + + + + + *+ + | * | + | * | + | * | + | * | + | * | + | * | + | * | + 1.5 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + | * | + 1 ++ A ++ + | * | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + 0.5 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + | * | + +* + + + + + 0 A+------+------+-------+-----++ + 1 1.5 2 2.5 3 + +EOF + +tryplot( testname => 'basic streaming test, twice as fast', + cmd => q{seq 500 | awk 'BEGIN{ print 0; } {print (NR==3)? "exit" : $0; fflush(); system("sleep 0.6");}'}, + options => [qw(--lines --points --stream 0.4)], + refplot => <<'EOF' ); + + + 1 ++----+-----+-----+-----+----+A + + + + + + *+ + | * | + | * | + | * | + | * | + | * | + 0.8 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 0.6 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 0.4 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 0.2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + +* + + + + + + 0 A+----+-----+-----+-----+----++ + 1 1.2 1.4 1.6 1.8 2 + + + + 2 ++------+------+-------+-----+A + + + + + *+ + | * | + | * | + | * | + | * | + | * | + | * | + | * | + 1.5 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + | * | + 1 ++ A ++ + | * | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + 0.5 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + | * | + +* + + + + + 0 A+------+------+-------+-----++ + 1 1.5 2 2.5 3 + +EOF + + +tryplot( testname => 'streaming with --xlen', + cmd => q{seq 500 | awk 'BEGIN{ print 0; } {print (NR==3)? "exit" : $0; fflush(); system("sleep 0.6");}'}, + options => [qw(--lines --points --stream 0.4 --xlen 1.1)], + refplot => <<'EOF' ); + + + 1 ++-+----+-----+----+-----+---+A + | + + + + + *+ + | * | + | * | + | * | + | * | + | * | + 0.8 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 0.6 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 0.4 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 0.2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | +* + + + + + + 0 ++-A----+-----+----+-----+---++ + 1 1.2 1.4 1.6 1.8 2 + + + + 2 ++-+----+-----+----+-----+---+A + | + + + + + *+ + | * | + | * | + | * | + | * | + | * | + 1.8 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 1.6 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 1.4 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 1.2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | +* + + + + + + 1 ++-A----+-----+----+-----+---++ + 2 2.2 2.4 2.6 2.8 3 + +EOF + +tryplot( testname => 'streaming with --monotonic', + cmd => q{seq 500 | awk '{if(NR==11) {print "exit";} else {x=(NR-1)%5; if(x==0) {print -1,-1;} print x,NR;}; fflush(); system("sleep 0.6");}'}, + options => [qw(--lines --points --stream 0.4 --domain --monotonic)], + refplot => <<'EOF' ); + + + 1 ++----+-----+-----+-----+----+A + + + + + + *+ + | * | + | * | + | * | + | * | + | * | + | * | + | * | + 0.5 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + -0.5 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + | * | + +* + + + + + + -1 A+----+-----+-----+-----+----++ + -1 -0.8 -0.6 -0.4 -0.2 0 + + + + 2 ++------+------+-------+-----+A + + + + + *+ + | ** | + | * | + | * | + | * | + 1.5 ++ ** ++ + | * | + | * | + | * | + | ** | + | * | + 1 ++ A ++ + | * | + | * | + | * | + | * | + 0.5 ++ * ++ + | * | + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + | * | + -0.5 ++ * ++ + | * | + | * | + | * | + |* | + +* + + + + + -1 A+------+------+-------+-----++ + -1 -0.5 0 0.5 1 + + + + 3 ++---+----+----+----+----+---+A + + + + + + + *+ + | * | + | * | + 2.5 ++ ** ++ + | * | + | * | + | * | + | * | + 2 ++ A ++ + | * | + | ** | + | * | + 1.5 ++ * ++ + | * | + | ** | + | * | + 1 ++ A ++ + | * | + | * | + | * | + | * | + 0.5 ++ * ++ + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + -0.5 ++* ++ + | * | + |* | + +* + + + + + + + -1 A+---+----+----+----+----+---++ + -1 -0.5 0 0.5 1 1.5 2 + + + + 4 ++--+---+---+---+---+---+---+--+A + + + + + + + + + *+ + | * | + | ** | + | * | + | * | + | * | + 3 ++ A ++ + | * | + | * | + | ** | + | * | + | * | + | * | + 2 ++ A ++ + | * | + | * | + | ** | + | * | + | * | + | * | + 1 ++ A ++ + | * | + | * | + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + |* | + +* + + + + + + + + + -1 A+--+---+---+---+---+---+---+--++ + -1 -0.5 0 0.5 1 1.5 2 2.5 3 + + + + 5 ++----+------+-----+------+----+A + + + + + + *+ + | * | + | * | + | * | + | * | + 4 ++ A ++ + | * | + | * | + | ** | + | * | + | * | + 3 ++ A ++ + | * | + | ** | + | * | + | * | + 2 ++ A ++ + | * | + | * | + | ** | + | * | + | * | + 1 ++ A ++ + | * | + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + |* | + +* + + + + + + -1 A+----+------+-----+------+----++ + -1 0 1 2 3 4 + + + + 6 ++----+------+-----+------+----+A + + + + + + *+ + | * | + | * | + | * | + 5 ++ * ++ + | * | + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + | * | + 3 ++ * ++ + | * | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + 1 ++ * ++ + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + +* + + + + + + -1 A+----+------+-----+------+----++ + -1 -0.8 -0.6 -0.4 -0.2 0 + + + + 7 ++------+-------+-------+-----**A + + + + + **** + + | **** | + | **** | + 6 ++ A* ++ + | * | + | * | + | * | + | * | + 5 ++ * ++ + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + 3 ++ * ++ + | * | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + 1 ++ * ++ + | * | + | * | + | * | + | * | + 0 ++* ++ + | * | + |* | + +* + + + + + -1 A+------+-------+-------+------++ + -1 -0.5 0 0.5 1 + + + + 8 ++---+-----+----+----+-----+---*A + + + + + + +*** + + | ** | + | *** | + 7 ++ *A* ++ + | ** | + | *** | + | ** | + 6 ++ A* ++ + | * | + | * | + | * | + 5 ++ * ++ + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + 3 ++ * ++ + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + 1 ++ * ++ + | * | + | * | + | * | + 0 ++* ++ + |* | + |* | + * + + + + + + + -1 A+---+-----+----+----+-----+---++ + -1 -0.5 0 0.5 1 1.5 2 + + + + 10 ++--+---+---+---+--+---+---+--++ + + + + + + + + + + + | | + | *A + | *** | + | ** | + 8 ++ *A* ++ + | ** | + | ** | + | *A* | + | *** | + | ** | + 6 ++ A* ++ + | * | + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + 0 +* ++ + |* | + * | + A | + | | + + + + + + + + + + + -2 ++--+---+---+---+--+---+---+--++ + -1 -0.5 0 0.5 1 1.5 2 2.5 3 + + + + 10 ++----+-----+------+-----+----*A + + + + + + ** + + | ** | + | *A | + | ** | + | ** | + 8 ++ *A ++ + | ** | + | ** | + | *A* | + | ** | + | ** | + 6 ++ A ++ + | * | + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + |* | + 0 +* ++ + |* | + * | + A | + | | + + + + + + + + -2 ++----+-----+------+-----+----++ + -1 0 1 2 3 4 + +EOF + + From 0f4fc698359a62850b259d3b7217d213ef314305 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 22:47:20 -0700 Subject: [PATCH 14/23] removed load test, since the functional tests all supersede it This allows me to drop the dependency on Test::Script::Run --- MANIFEST | 1 - t/00-load.t | 16 ---------------- 2 files changed, 17 deletions(-) delete mode 100644 t/00-load.t diff --git a/MANIFEST b/MANIFEST index c2ff39a..76dee53 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,7 +1,6 @@ Makefile.PL MANIFEST bin/feedgnuplot -t/00-load.t t/manifest.t t/plots.t Changes diff --git a/t/00-load.t b/t/00-load.t deleted file mode 100644 index 0a99850..0000000 --- a/t/00-load.t +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/perl - -# require a threaded perl for my tests. This block lifted verbatim from the cpantesters wiki -BEGIN { - use Config; - if (! $Config{'useithreads'}) { - print("1..0 # Skip: Perl not compiled with 'useithreads'\n"); - exit(0); - } -} - -use Test::More tests => 1; -use Test::Script::Run; - -run_ok( 'feedgnuplot', ['--help'], 'feedgnuplot can run'); - From 6f23f89c28fe26ce9e8129ae711320c1cc86f4e3 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 22:52:55 -0700 Subject: [PATCH 15/23] minor update to the timefmt doc --- bin/feedgnuplot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index a6441af..aa98136 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -1083,6 +1083,10 @@ C<--timefmt>. Example: This plots the 'idle' CPU consumption against time. +Note that while gnuplot supports the time/date on any axis, I +currently supports it I as the x-axis domain. This may change in the +future. + =head2 Real-time streaming data To plot real-time data, pass in the C<--stream [refreshperiod]> option. Data From 74e95d8e6f87b915213899bfd5f426627ff58bbb Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 23:37:17 -0700 Subject: [PATCH 16/23] If using --timefmt then --xlen MUST have an integer argument I use strftime() and strptime() to deal with xlen in the timefmt case, and those functions only work with integers --- bin/feedgnuplot | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index aa98136..975d9e6 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -314,6 +314,17 @@ sub interpretCommandline $options{timefmt_Ncols} = $Nfields; my $regex_str = join( '\s+', ('\S+') x $Nfields ); $options{timefmt_regex} = qr/$regex_str/; + + # make sure --xlen is an integer. With a timefmt xlen goes through strptime + # and strftime, and those are integer-only + if( defined $options{xlen} ) + { + if( $options{xlen} - int($options{xlen}) ) + { + say STDERR "When streaming --xlen MUST be an integer. Rounding up to the nearest second"; + $options{xlen} = 1 + int($options{xlen}); + } + } } } @@ -1061,7 +1072,7 @@ given, some other options act a little bit differently: =item -C<--xlen> is in seconds +C<--xlen> is an I in seconds =item @@ -1103,7 +1114,7 @@ windowsize> can be given. This will create an constantly-updating, scrolling view of the recent past. C should be replaced by the desired length of the domain window to plot, in domain units (passed-in values if C<--domain> or line numbers otherwise). If the domain is a time/date via C<--timefmt>, then -C is in seconds. +C is and I in seconds. =head3 Special data commands From 54862ec2fd90a58d16d8b1d34ae8840b845b5b84 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 23:55:47 -0700 Subject: [PATCH 17/23] added --timefmt tests --- t/plots.t | 643 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 641 insertions(+), 2 deletions(-) diff --git a/t/plots.t b/t/plots.t index cd1b690..57ec853 100644 --- a/t/plots.t +++ b/t/plots.t @@ -15,7 +15,7 @@ BEGIN { } } -use Test::More tests => 42; +use Test::More tests => 52; use File::Temp 'tempfile'; use IPC::Run 'run'; use String::ShellQuote; @@ -823,13 +823,157 @@ tryplot( testname => 'Monotonicity check', EOF +tryplot( testname => 'basic --timefmt plot', + cmd => q{seq 5 | awk '{print strftime("%d %b %Y %T",1382249107+$1,1),$1}'}, + options => ['--domain', '--timefmt', '%d %b %Y %H:%M:%S'], + refplot => <<'EOF' ); + + + 5 ++--+---+--+---+---+---+--+--+A + + + + + + + + + + + | | + | | + 4.5 ++ ++ + | | + | | + | | + | | + 4 ++ A ++ + | | + | | + | | + 3.5 ++ ++ + | | + | | + | | + 3 ++ A ++ + | | + | | + | | + | | + 2.5 ++ ++ + | | + | | + | | + 2 ++ A ++ + | | + | | + | | + | | + 1.5 ++ ++ + | | + | | + + + + + + + + + + + 1 A+--+---+--+---+---+---+--+--++ + 05:085:085:09:095:105:105:11:115:12 + +EOF + +tryplot( testname => '--timefmt plot with bounds', + cmd => q{seq 5 | awk '{print strftime("%d %b %Y %T",1382249107+$1,1),$1}'}, + options => ['--domain', '--timefmt', '%d %b %Y %H:%M:%S', + '--xmin', '20 Oct 2013 06:05:00', + '--xmax', '20 Oct 2013 06:05:20'], + refplot => <<'EOF' ); + + + 5 ++++-++-++-++-++-+A-++-++-++-++ + + + + + + + | | + | | + 4.5 ++ ++ + | | + | | + | | + | | + 4 ++ A ++ + | | + | | + | | + 3.5 ++ ++ + | | + | | + | | + 3 ++ A ++ + | | + | | + | | + | | + 2.5 ++ ++ + | | + | | + | | + 2 ++ A ++ + | | + | | + | | + | | + 1.5 ++ ++ + | | + | | + + + + + + + 1 ++++-++-++-+A-++-++-++-++-++-++ + 05:00 05:05 05:10 05:15 05:20 + +EOF + +tryplot( testname => '--timefmt plot with --monotonic', + cmd => q{seq 10 | awk '{x=(NR-1)%5; print strftime("%d %b %Y %T",1382249107+x,1),$1}'}, + options => ['--domain', '--timefmt', '%d %b %Y %H:%M:%S', + '--monotonic'], + refplot => <<'EOF' ); + + + 10 ++--+---+--+---+---+---+--+--+A + + + + + + + + + + + | | + | | + 9.5 ++ ++ + | | + | | + | | + | | + 9 ++ A ++ + | | + | | + | | + 8.5 ++ ++ + | | + | | + | | + 8 ++ A ++ + | | + | | + | | + | | + 7.5 ++ ++ + | | + | | + | | + 7 ++ A ++ + | | + | | + | | + | | + 6.5 ++ ++ + | | + | | + + + + + + + + + + + 6 A+--+---+--+---+---+---+--+--++ + 05:075:075:08:085:095:095:10:105:11 + +EOF + + + + note( "Starting to run streaming tests. These will take several seconds each" ); # replotting every 1.0 seconds. Data comes in every 1.1 seconds. Two data # points, and then "exit", so I should have two frames worth of data plotted. I # pre-send a 0 so that the gnuplot autoscaling is always well-defined tryplot( testname => 'basic streaming test', - cmd => q{seq 500 | awk 'BEGIN{ print 0; } {print (NR==3)? "exit" : $0; fflush(); system("sleep 1.1");}'}, + cmd => q{seq 500 | awk 'BEGIN{ print 0; } {print (NR==3)? "exit" : $0; fflush(); system("sleep 1.2");}'}, options => [qw(--lines --points --stream)], refplot => <<'EOF' ); @@ -1493,6 +1637,501 @@ tryplot( testname => 'streaming with --monotonic', EOF +tryplot( testname => '--timefmt streaming plot with --xlen', + cmd => q{seq 5 | awk 'BEGIN{ print strftime("%d %b %Y %T",1382249107-1,1),-4;} {if(NR==3) {print "exit";} else{ print strftime("%d %b %Y %T",1382249107+$1,1),$1;} fflush(); system("sleep 0.6")}'}, + options => ['--points', '--lines', + '--domain', '--timefmt', '%d %b %Y %H:%M:%S', + qw(--stream 0.4 --xlen 3)], + refplot => <<'EOF' ); + + + 1 ++---+-----+----+----+-----+---+A + + + + + + + *+ + | *| + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + -1 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + -2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + -3 ++ * ++ + | * | + | * | + | * | + | * | + | * | + + + +* + + + + + -4 ++---+-----A----+----+-----+---++ + 05:0505:05 05:0605:0605:07 05:0705:08 + + + + 2 ++---+-----+----+----+-----+---+A + + + + + + + **+ + | ** | + | ** | + | ** | + | ** | + 1 ++ A ++ + | * | + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + -1 ++ * ++ + | * | + | * | + | * | + | * | + | * | + -2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + -3 ++ * ++ + | * | + | * | + | * | + |* | + +* + + + + + + + -4 A+---+-----+----+----+-----+---++ + 05:0605:06 05:0705:0705:08 05:0805:09 + +EOF + +tryplot( testname => '--timefmt streaming plot with --monotonic', + cmd => q{seq 10 | awk '{x=(NR-1)%5; if(x==0) {print strftime("%d %b %Y %T",1382249107-1,-4),-4;} print strftime("%d %b %Y %T",1382249107+x,1),NR; fflush(); system("sleep 0.6")}'}, + options => ['--points', '--lines', + '--domain', '--timefmt', '%d %b %Y %H:%M:%S', + qw(--stream 0.4 --monotonic)], + refplot => <<'EOF' ); + + + 1 ++----+------+-----+------+----+A + + + + + + *+ + | * | + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + -1 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + -2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + -3 ++ * ++ + | * | + | * | + | * | + | * | + | * | + +* + + + + + + -4 A+----+------+-----+------+----++ + 05:06 05:06 05:06 05:06 05:06 05:07 + + + + 2 ++------+-------+-------+------*A + + + + + *** + + | ** | + | *** | + | *** | + | ** | + 1 ++ A* ++ + | * | + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + -1 ++ * ++ + | * | + | * | + | * | + | * | + | * | + -2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + -3 ++ * ++ + | * | + | * | + | * | + |* | + +* + + + + + -4 A+------+-------+-------+------++ + 05:06 05:06 05:07 05:07 05:08 + + + + 3 ++---+-----+----+----+-----+---*A + + + + + + + ** + + | ** | + | ** | + | ** | + 2 ++ *A* ++ + | ** | + | ** | + | ** | + | ** | + 1 ++ A ++ + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + -1 ++ * ++ + | * | + | * | + | * | + | * | + -2 ++ * ++ + | * | + | * | + | * | + | * | + -3 ++* ++ + | * | + |* | + |* | + * + + + + + + + -4 A+---+-----+----+----+-----+---++ + 05:0605:06 05:0705:0705:08 05:0805:09 + + + + 4 ++--+---+---+---+---+---+---+--*A + + + + + + + + +** + + | ** | + | ** | + 3 ++ A ++ + | ** | + | ** | + | * | + | ** | + 2 ++ *A ++ + | ** | + | ** | + | ** | + 1 ++ A ++ + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + -1 ++ * ++ + | * | + | * | + | * | + -2 ++ * ++ + | * | + | * | + | * | + | * | + -3 +* ++ + |* | + |* | + * + + + + + + + + + -4 A+--+---+---+---+---+---+---+--++ + 05:065:065:075:075:085:085:095:095:10 + + + + 5 ++----+------+-----+------+----+A + + + + + + **+ + | * | + | ** | + 4 ++ A ++ + | ** | + | ** | + | ** | + 3 ++ A ++ + | ** | + | * | + | ** | + 2 ++ A ++ + | ** | + | ** | + | ** | + 1 ++ A ++ + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + -1 ++ * ++ + | * | + | * | + | * | + -2 ++ * ++ + | * | + | * | + | * | + -3 +* ++ + |* | + |* | + * + + + + + + -4 A+----+------+-----+------+----++ + 05:06 05:07 05:08 05:09 05:10 05:11 + + + + 6 ++----+------+-----+------+----+A + + + + + + *+ + | * | + | * | + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + | * | + | * | + -2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + +* + + + + + + -4 A+----+------+-----+------+----++ + 05:06 05:06 05:06 05:06 05:06 05:07 + + + + 8 ++------+-------+-------+------++ + + + + + + + | | + | **A + | ****** | + | ***** | + 6 ++ A** ++ + | * | + | * | + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + | * | + -2 ++ * ++ + | * | + | * | + | * | + |* | + +* + + + + + -4 A+------+-------+-------+------++ + 05:06 05:06 05:07 05:07 05:08 + + + + 8 ++---+-----+----+----+-----+---*A + + + + + + **** + + | **** | + | *A* | + | **** | + | *** | + 6 ++ A* ++ + | * | + | * | + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + | * | + -2 ++* ++ + | * | + | * | + |* | + |* | + * + + + + + + + -4 A+---+-----+----+----+-----+---++ + 05:0605:06 05:0705:0705:08 05:0805:09 + + + + 10 ++--+---+---+---+--+---+---+--++ + + + + + + + + + + + | *A + | *** | + | ** | + 8 ++ *A* ++ + | **** | + | *A* | + | *** | + | ** | + 6 ++ A* ++ + | * | + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + -2 ++* ++ + |* | + |* | + |* | + * + + + + + + + + + -4 A+--+---+---+---+--+---+---+--++ + 05:065:065:075:075:08:085:095:095:10 + + + + 10 ++----+-----+------+-----+----*A + + + + + + *** + + | *A* | + | ** | + | ** | + 8 ++ *A ++ + | **** | + | *A* | + | ** | + | ** | + 6 ++ A ++ + | * | + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + 0 ++* ++ + | * | + | * | + | * | + |* | + -2 +* ++ + |* | + |* | + * | + * + + + + + + -4 A+----+-----+------+-----+----++ + 05:06 05:07 05:08 05:09 05:10 05:11 + +EOF From 48254eefa88287e661e026ea2eab7f9f24857940 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 19 Oct 2013 23:56:12 -0700 Subject: [PATCH 18/23] test harness prints out the actual command being executed --- t/plots.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/plots.t b/t/plots.t index 57ec853..a9fd8b8 100644 --- a/t/plots.t +++ b/t/plots.t @@ -2143,16 +2143,16 @@ sub tryplot my @options = ('--exit', '--extracmds', 'unset grid', '--terminal', 'dumb 40,40'); - unshift @options, @{$args{options}}; + my $feedgnuplot = dirname($0) . "/../bin/feedgnuplot"; my $out = ''; my $err = ''; open IN, '-|', $args{cmd} or die "Couldn't open pipe to $args{cmd}"; - run [dirname($0) . "/../bin/feedgnuplot",, @options], + run [$feedgnuplot, @options], \*IN, \$out, \$err; - note( "Running test '$args{testname}'. Running: $args{cmd} | feedgnuplot " . + note( "Running test '$args{testname}'. Running: $args{cmd} | $feedgnuplot " . shell_quote(@options)); is($err, '', "$args{testname} stderr" ); is($out, $args{refplot}, "$args{testname} stdout"); From 0ca3482607a9cc844b8eb732fc08e44a339de3b9 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sun, 20 Oct 2013 00:09:10 -0700 Subject: [PATCH 19/23] all tests now produce a higher-resolution plot --- t/plots.t | 3514 ++++++++++++++++++++++++++--------------------------- 1 file changed, 1757 insertions(+), 1757 deletions(-) diff --git a/t/plots.t b/t/plots.t index a9fd8b8..f1aa591 100644 --- a/t/plots.t +++ b/t/plots.t @@ -27,43 +27,43 @@ tryplot( testname => 'basic line plot', refplot => <<'EOF' ); - 5 ++--+---+--+---+---+---+--+--+A - + + + + + + + + *+ - | * | - | * | - 4.5 ++ * ++ - | * | - | * | - | * | - | * | - 4 ++ A ++ - | * | - | * | - | * | - 3.5 ++ * ++ - | * | - | * | - | * | - 3 ++ A ++ - | * | - | * | - | * | - | * | - 2.5 ++ * ++ - | * | - | * | - | * | - 2 ++ A ++ - | * | - | * | - | * | - | * | - 1.5 ++ * ++ - | * | - | * | - +* + + + + + + + + - 1 A+--+---+--+---+---+---+--+--++ - 1 1.5 2 2.5 3 3.5 4 4.5 5 + 5 ++---------+-----------+----------+----------+----------+-----------+----------+---------*A + + + + + + + + + ** + + | *** | + | ** | + 4.5 ++ *** ++ + | ** | + | ** | + | *** | + | ** | + 4 ++ *A* ++ + | *** | + | *** | + | *** | + 3.5 ++ ** ++ + | *** | + | *** | + | *** | + 3 ++ *A* ++ + | ** | + | *** | + | ** | + | *** | + 2.5 ++ ** ++ + | ** | + | *** | + | ** | + 2 ++ *A* ++ + | ** | + | *** | + | ** | + | *** | + 1.5 ++ *** ++ + | ** | + | *** | + + ** + + + + + + + + + 1 A*---------+-----------+----------+----------+----------+-----------+----------+---------++ + 1 1.5 2 2.5 3 3.5 4 4.5 5 EOF @@ -74,43 +74,43 @@ tryplot( testname => 'basic line plot to piped hardcopy', refplot => <<'EOF' ); - 5 ++--+---+--+---+---+---+--+--+A - + + + + + + + + *+ - | * | - | * | - 4.5 ++ * ++ - | * | - | * | - | * | - | * | - 4 ++ A ++ - | * | - | * | - | * | - 3.5 ++ * ++ - | * | - | * | - | * | - 3 ++ A ++ - | * | - | * | - | * | - | * | - 2.5 ++ * ++ - | * | - | * | - | * | - 2 ++ A ++ - | * | - | * | - | * | - | * | - 1.5 ++ * ++ - | * | - | * | - +* + + + + + + + + - 1 A+--+---+--+---+---+---+--+--++ - 1 1.5 2 2.5 3 3.5 4 4.5 5 + 5 ++---------+-----------+----------+----------+----------+-----------+----------+---------*A + + + + + + + + + ** + + | *** | + | ** | + 4.5 ++ *** ++ + | ** | + | ** | + | *** | + | ** | + 4 ++ *A* ++ + | *** | + | *** | + | *** | + 3.5 ++ ** ++ + | *** | + | *** | + | *** | + 3 ++ *A* ++ + | ** | + | *** | + | ** | + | *** | + 2.5 ++ ** ++ + | ** | + | *** | + | ** | + 2 ++ *A* ++ + | ** | + | *** | + | ** | + | *** | + 1.5 ++ *** ++ + | ** | + | *** | + + ** + + + + + + + + + 1 A*---------+-----------+----------+----------+----------+-----------+----------+---------++ + 1 1.5 2 2.5 3 3.5 4 4.5 5 Wrote output to |cat EOF @@ -121,43 +121,43 @@ tryplot( testname => 'basic lines-only plot', refplot => <<'EOF' ); - 5 ++--+---+--+---+---+---+--+--+* - + + + + + + + + *+ - | * | - | * | - 4.5 ++ * ++ - | * | - | * | - | * | - | * | - 4 ++ * ++ - | * | - | * | - | * | - 3.5 ++ * ++ - | * | - | * | - | * | - 3 ++ * ++ - | * | - | * | - | * | - | * | - 2.5 ++ * ++ - | * | - | * | - | * | - 2 ++ * ++ - | * | - | * | - | * | - | * | - 1.5 ++ * ++ - | * | - | * | - +* + + + + + + + + - 1 *+--+---+--+---+---+---+--+--++ - 1 1.5 2 2.5 3 3.5 4 4.5 5 + 5 ++---------+-----------+----------+----------+----------+-----------+----------+---------** + + + + + + + + + ** + + | *** | + | ** | + 4.5 ++ *** ++ + | ** | + | ** | + | *** | + | ** | + 4 ++ *** ++ + | *** | + | *** | + | *** | + 3.5 ++ ** ++ + | *** | + | *** | + | *** | + 3 ++ *** ++ + | ** | + | *** | + | ** | + | *** | + 2.5 ++ ** ++ + | ** | + | *** | + | ** | + 2 ++ *** ++ + | ** | + | *** | + | ** | + | *** | + 1.5 ++ *** ++ + | ** | + | *** | + + ** + + + + + + + + + 1 **---------+-----------+----------+----------+----------+-----------+----------+---------++ + 1 1.5 2 2.5 3 3.5 4 4.5 5 EOF @@ -167,43 +167,43 @@ tryplot( testname => 'basic points-only plot', refplot => <<'EOF' ); - 5 ++--+---+--+---+---+---+--+--+A - + + + + + + + + + - | | - | | - 4.5 ++ ++ - | | - | | - | | - | | - 4 ++ A ++ - | | - | | - | | - 3.5 ++ ++ - | | - | | - | | - 3 ++ A ++ - | | - | | - | | - | | - 2.5 ++ ++ - | | - | | - | | - 2 ++ A ++ - | | - | | - | | - | | - 1.5 ++ ++ - | | - | | - + + + + + + + + + - 1 A+--+---+--+---+---+---+--+--++ - 1 1.5 2 2.5 3 3.5 4 4.5 5 + 5 ++---------+-----------+----------+----------+----------+-----------+----------+---------+A + + + + + + + + + + + | | + | | + 4.5 ++ ++ + | | + | | + | | + | | + 4 ++ A ++ + | | + | | + | | + 3.5 ++ ++ + | | + | | + | | + 3 ++ A ++ + | | + | | + | | + | | + 2.5 ++ ++ + | | + | | + | | + 2 ++ A ++ + | | + | | + | | + | | + 1.5 ++ ++ + | | + | | + + + + + + + + + + + 1 A+---------+-----------+----------+----------+----------+-----------+----------+---------++ + 1 1.5 2 2.5 3 3.5 4 4.5 5 EOF @@ -214,43 +214,43 @@ tryplot( testname => 'basic line plot with bounds', refplot => <<'EOF' ); - ++---+----+---+---+---+----+---++ - |+ + + + + + + +| - | | - 5 ++ ++ - | | - | | - | * - | * - | *| - 4 ++ A+ - | *| - | * | - | * | - | * | - | * | - 3 ++ A ++ - | * | - | * | - | * | - | * | - 2 ++ A ++ - | * | - | * | - | * | - | * | - | * | - 1 ++ A ++ - | | - | | - | | - | | - | | - 0 ++ ++ - | | - |+ + + + + + + +| - ++---+----+---+---+---+----+---++ - -10 -8 -6 -4 -2 0 2 4 + +--+-----------+------------+-----------+-----------+-----------+------------+-----------+--+ + | + + + + + + + + | + | | + 5 ++ ++ + | | + | | + | * + | *| + | * | + 4 ++ A ++ + | * | + | * | + | * | + | * | + | * | + 3 ++ A ++ + | * | + | ** | + | * | + | * | + 2 ++ A ++ + | * | + | * | + | * | + | * | + | * | + 1 ++ A ++ + | | + | | + | | + | | + | | + 0 ++ ++ + | | + | + + + + + + + + | + +--+-----------+------------+-----------+-----------+-----------+------------+-----------+--+ + -10 -8 -6 -4 -2 0 2 4 EOF @@ -261,43 +261,43 @@ tryplot( testname => 'basic line plot with bounds, square aspect ratio', refplot => <<'EOF' ); - - - - - - - - - - - - ++---+----+---+---+---+----+---++ - 5 ++ + + + + + + ++ - | * - 4 ++ A+ - | * | - 3 ++ A ++ - | * | - | * | - 2 ++ A ++ - | * | - 1 ++ A ++ - | | - 0 ++ + + + + + + ++ - ++---+----+---+---+---+----+---++ - -10 -8 -6 -4 -2 0 2 4 - - - - - - - - - - - + +--+-----------+----------+-----------+-----------+-----------+----------+-----------+--+ + | + + + + + + + + | + | | + 5 ++ ++ + | | + | | + | * + | *| + | * | + 4 ++ A ++ + | * | + | * | + | * | + | * | + | * | + 3 ++ A ++ + | * | + | ** | + | * | + | * | + 2 ++ A ++ + | * | + | * | + | * | + | * | + | * | + 1 ++ A ++ + | | + | | + | | + | | + | | + 0 ++ ++ + | | + | + + + + + + + + | + +--+-----------+----------+-----------+-----------+-----------+----------+-----------+--+ + -10 -8 -6 -4 -2 0 2 4 EOF @@ -309,44 +309,44 @@ tryplot( testname => 'lines on both axes with labels, legends, titles', qw(--y2 1 --y2label y2 --xlabel x --ylabel y --y2max 30)], refplot => <<'EOF' ); - Test plot - y2 - 10 ++-+---+--+--+--+---+--+-+A 30 - + + + + + + + + *+ - | data 0 **A****| - | * | - 9 ++ * | - | * +B 25 - | * #| - | * #| - 8 ++ A # | - | * # | - | * # | - | * # ++ 20 - 7 ++ * # | - | * # | - | * # | - | * B | - 6 ++ A # ++ 15 - | * # | - | * # | - | * # | - | * # | - 5 ++ * # | - | * # ++ 10 - | * B | - | * # | - 4 ++ A # | - | * # | - | * # ++ 5 - | * # | - 3 ++ * #B | - | *## | - | *# | - B* + + + + + + + + - 2 A+-+---+--+--+--+---+--+-++ 0 - 1 1.5 2 2.5 3 3.5 4 4.5 5 - x + Test plot + y2 + 10 ++---------+----------+---------+----------+----------+----------+---------+---------*A 30 + + + + + + + + + ** + + | data 0 **A*** | + | *** | + 9 ++ ** | + | *** #B 25 + | *** ## | + | ** ## | + 8 ++ *A* ## | + | *** ## | + | ** ## | + | *** ## ++ 20 + 7 ++ *** ## | + | *** ## | + | ** ## | + | *** #B# | + 6 ++ *A* ### ++ 15 + | ** ## | + | ** ### | + | *** ### | + | ** ### | + 5 ++ ** ## | + | *** ### ++ 10 + | ** #B# | + | ** #### | + 4 ++ *A* ### | + | *** #### | + | ** ### ++ 5 + | *** #### | + 3 ++ *** ###B# | + | *** ######## | + | #**#### | + B#*** + + + + + + + + + 2 A*---------+----------+---------+----------+----------+----------+---------+---------++ 0 + 1 1.5 2 2.5 3 3.5 4 4.5 5 + x EOF @@ -359,44 +359,44 @@ tryplot( testname => 'lines on both axes with labels, legends, titles; different '--curvestyle', '1', 'with points ps 3 pt 7'], refplot => <<'EOF' ); - Test plot - y2 - 10 ++-+---+--+--+--+---+--+-+* 30 - + + + + + + + + *+ - | data 0 *******| - | * | - 9 ++ * | - | * +G 25 - | * | - | * | - 8 ++ * | - | * | - | * | - | * ++ 20 - 7 ++ * | - | * | - | * | - | * G | - 6 ++ * ++ 15 - | * | - | * | - | * | - | * | - 5 ++ * | - | * ++ 10 - | * G | - | * | - 4 ++ * | - | * | - | * ++ 5 - | * | - 3 ++ * G | - | * | - | * | - G* + + + + + + + + - 2 *+-+---+--+--+--+---+--+-++ 0 - 1 1.5 2 2.5 3 3.5 4 4.5 5 - x + Test plot + y2 + 10 ++---------+----------+---------+----------+----------+----------+---------+---------** 30 + + + + + + + + + ** + + | data 0 ****** | + | *** | + 9 ++ ** | + | *** +G 25 + | *** | + | ** | + 8 ++ *** | + | *** | + | ** | + | *** ++ 20 + 7 ++ *** | + | *** | + | ** | + | *** G | + 6 ++ *** ++ 15 + | ** | + | ** | + | *** | + | ** | + 5 ++ ** | + | *** ++ 10 + | ** G | + | ** | + 4 ++ *** | + | *** | + | ** ++ 5 + | *** | + 3 ++ *** G | + | *** | + | ** | + G *** + + + + + + + + + 2 **---------+----------+---------+----------+----------+----------+---------+---------++ 0 + 1 1.5 2 2.5 3 3.5 4 4.5 5 + x EOF @@ -406,43 +406,43 @@ tryplot( testname => 'domain plot', refplot => <<'EOF' ); - 25 ++--+---+---+---+--+---+---+--+A - + + + + + + + + *+ - | *| - | * | - | * | - | * | - | * | - 20 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | A | - 15 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 10 ++ * ++ - | A | - | * | - | * | - | ** | - | * | - | * | - 5 ++ * ++ - | A | - | ** | - | ** | - | * | - |** | - A + + + + + + + + - 0 ++--+---+---+---+--+---+---+--++ - 2 3 4 5 6 7 8 9 10 + 25 ++---------+-----------+----------+-----------+----------+----------+-----------+---------+A + + + + + + + + + **+ + | ** | + | ** | + | * | + | ** | + | ** | + 20 ++ ** ++ + | ** | + | * | + | ** | + | ** | + | ** | + | *A | + 15 ++ ** ++ + | *** | + | ** | + | *** | + | ** | + | ** | + | *** | + 10 ++ ** ++ + | *A* | + | *** | + | **** | + | *** | + | *** | + | **** | + 5 ++ *** ++ + | **A* | + | **** | + | ***** | + | ***** | + | **** | + A** + + + + + + + + + 0 ++---------+-----------+----------+-----------+----------+----------+-----------+---------++ + 2 3 4 5 6 7 8 9 10 EOF @@ -453,43 +453,43 @@ tryplot( testname => 'dataid plot', refplot => <<'EOF' ); - 25 ++--+---+---+---+--+---+---+--+E - + + + + + + + + + - | 2 **A*** | - | 4 ##B### | - | 6 $$C$$$ | - | 8 %%D%%% | - | 10 @@E@@@ | - 20 ++ ++ - | | - | | - | | - | | - | | - | D | - 15 ++ ++ - | | - | | - | | - | | - | | - | | - 10 ++ ++ - | C | - | | - | | - | | - | | - | | - 5 ++ ++ - | B | - | | - | | - | | - | | - A + + + + + + + + - 0 ++--+---+---+---+--+---+---+--++ - 1 1.5 2 2.5 3 3.5 4 4.5 5 + 25 ++---------+-----------+----------+-----------+----------+----------+-----------+---------+E + + + + + + + + + + + | 2 **A*** | + | 4 ##B### | + | 6 $$C$$$ | + | 8 %%D%%% | + | 10 @@E@@@ | + 20 ++ ++ + | | + | | + | | + | | + | | + | D | + 15 ++ ++ + | | + | | + | | + | | + | | + | | + 10 ++ ++ + | C | + | | + | | + | | + | | + | | + 5 ++ ++ + | B | + | | + | | + | | + | | + A + + + + + + + + + 0 ++---------+-----------+----------+-----------+----------+----------+-----------+---------++ + 1 1.5 2 2.5 3 3.5 4 4.5 5 EOF @@ -506,34 +506,34 @@ tryplot( testname => '3d spiral with bounds, labels', - A*AA*AA* - * A* - AA - A - A - * - + A - 40 |+ A*A*AAA* A - | A A*A* A - 30 |+ AA A A - | A A - z 20 |+ AA A A - | AA*AA*A*AA*A*A A - 10 |+ +- A - | -+ --- A - 0 |+ -+ + --- - | -+ +--- - | --+ + --- - | -++ +- 1 - | -+ 0.8 - |-+ 0.6 - ++--- - 0.4 - -21.5 +--- -+ 0.2 - -1+ + +-- +-0.2 - -0.50+ +--- +-0.4 - 0.51++-+-0.6 - 1.5+-1.8 - 2 + ***A****A****A****A***A** + * **A** + **A***A* + *A* + *A + * + + A + 40 |+ **A****A****A****A***A** A + | **A **A****A** A + 30 |+ A*A *A** *A + | A *AA* + z 20 |+ AA** **A* *A* + | A**A***A***A****A*****A***A****A****A* AA + 10 |+ -+---- A + | ---- +--------- A + 0 |+ ---+ + --------- + | ---++ +-+--------- + | ----++ + --------- + | ---+ + ----- 1 + | ---+ --- 0.8 + | ----+ --++ 0.6 + +-+++--------- --- 0.20.4 + -2 -1.5 ++ +--------- --- 0 + -1 + ++ --+------ --- -0.2 + -0.5 0 + ++ --------- ---+ -0.4 + 0.5 1 ++ -+--- --0.8.6 + 1.5 + +-1+ + 2 @@ -555,30 +555,30 @@ tryplot( testname => '3d spiral with bounds, labels, square xy aspect ratio', - *AA* - AA*A - A - + A*A - 40 |+ A - | A - 30 |+ A - | AAAAA* A - z 20 |+AA AA A - | AA* A*A AA - | AA*AAA*AA*A - 10 |+ AAA - 0 |+ A - | A - | +- A - | -++--- - | --+ +--- - |-++ +--- - +++-- --- - -21.5+--- +- 1 - -10.5--- + 0.6 - 0 +--- + 024 - 0.5 ++-0.4 - 1.521.8 + *AA* + AA*A + A + + A*A + 40 |+ A + | A + 30 |+ A + | AAAAA* A + z 20 |+AA AA A + | AA* A*A AA + | AA*AAA*AA*A + 10 |+ AAA + 0 |+ A + | A + | +- A + | -++--- + | --+ +--- + |-++ +--- + +++-- --- + -21.5+--- +- 1 + -10.5--- + 0.6 + 0 +--- + 024 + 0.5 ++-0.4 + 1.521.8 @@ -596,43 +596,43 @@ tryplot( testname => 'Histogram plot', refplot => <<'EOF' ); - 4 ++--**---+---+---+---+----+--++ - + ** + + + + + + - | ** | - | ** | - 3.5 ++ ** ++ - | ** | - | ** | - | ** | - | ** | - 3 ++ ** ++ - | ** | - | ** | - | ** | - 2.5 ++ ** ++ - | ** | - | ** | - | ** | - 2 ++ **** ++ - | **** | - | **** | - | **** | - | **** | - 1.5 ++ **** ++ - | **** | - | **** | - | **** | - 1 ++ *********************** ++ - | *********************** | - | *********************** | - | *********************** | - | *********************** | - 0.5 ++ *********************** ++ - | *********************** | - | *********************** | - + *********************** + - 0 ++--***********************--++ - -500 0 500 100015002000 25003000 + 4 ++----------****----------+------------+-----------+------------+------------+-----------++ + + *+** + + + + + + + | * ** | + | * ** | + 3.5 ++ * ** ++ + | * ** | + | * ** | + | * ** | + | * ** | + 3 ++ * *** ++ + | * *** | + | * *** | + | * *** | + 2.5 ++ * *** ++ + | * *** | + | * *** | + | * *** | + 2 ++ * **** *** ++ + | * **** *** | + | * **** *** | + | * **** *** | + | * **** *** | + 1.5 ++ * **** *** ++ + | * **** *** | + | * **** *** | + | * **** *** | + 1 ++ * ************************** ******** ************************** ** ++ + | * **** *** **** *** **** *** **** *** **** *** **** *** **** *** ** | + | * **** *** **** *** **** *** **** *** **** *** **** *** **** *** ** | + | * **** *** **** *** **** *** **** *** **** *** **** *** **** *** ** | + | * **** *** **** *** **** *** **** *** **** *** **** *** **** *** ** | + 0.5 ++ * **** *** **** *** **** *** **** *** **** *** **** *** **** *** ** ++ + | * **** *** **** *** **** *** **** *** **** *** **** *** **** *** ** | + | * **** *** **** *** **** *** **** *** **** *** **** *** **** *** ** | + + *+**** *** **** *** **** *** **** *** **** *** **** *** **** *** ** + + 0 ++----------****************************-********-**************************-**----------++ + -500 0 500 1000 1500 2000 2500 3000 EOF @@ -643,43 +643,43 @@ tryplot( testname => 'Cumulative histogram', refplot => <<'EOF' ); - 50 ++--+----+---+----+---+---**--++ - + + + + + + *** + - | **** | - | ****** | - | ******* | - | ******* | - | ********* | - 40 ++ ********** ++ - | *********** | - | ************ | - | ************* | - | ************** | - | ************** | - | *************** | - 30 ++ **************** ++ - | ***************** | - | ***************** | - | ****************** | - | ****************** | - | ******************* | - | ******************** | - 20 ++ ******************** ++ - | ********************* | - | ********************* | - | ********************** | - | ********************** | - | ********************** | - | *********************** | - 10 ++ *********************** ++ - | *********************** | - | *********************** | - | *********************** | - | ************************ | - | ************************ | - + ************************ + - 0 ++--************************--++ - -500 0 500 1000 15002000 25003000 + 50 ++-----------+------------+------------+------------+------------+-----------***----------++ + + + + + + + ** ***+* + + | **** *** * | + | *** **** *** * | + | ** *** **** *** * | + | ***** *** **** *** * | + | **** *** *** **** *** * | + 40 ++ ** **** *** *** **** *** * ++ + | ****** **** *** *** **** *** * | + | ***** *** **** *** *** **** *** * | + | *** *** *** **** *** *** **** *** * | + | ****** *** *** **** *** *** **** *** * | + | ** **** *** *** **** *** *** **** *** * | + | ****** **** *** *** **** *** *** **** *** * | + 30 ++ *** *** **** *** *** **** *** *** **** *** * ++ + | ****** *** **** *** *** **** *** *** **** *** * | + | *** *** *** **** *** *** **** *** *** **** *** * | + | ****** *** *** **** *** *** **** *** *** **** *** * | + | ** **** *** *** **** *** *** **** *** *** **** *** * | + | *** **** *** *** **** *** *** **** *** *** **** *** * | + | ****** **** *** *** **** *** *** **** *** *** **** *** * | + 20 ++ *** *** **** *** *** **** *** *** **** *** *** **** *** * ++ + | ****** *** **** *** *** **** *** *** **** *** *** **** *** * | + | ** *** *** **** *** *** **** *** *** **** *** *** **** *** * | + | *** *** *** **** *** *** **** *** *** **** *** *** **** *** * | + | **** *** *** **** *** *** **** *** *** **** *** *** **** *** * | + | ****** *** *** **** *** *** **** *** *** **** *** *** **** *** * | + | ** **** *** *** **** *** *** **** *** *** **** *** *** **** *** * | + 10 ++ ** **** *** *** **** *** *** **** *** *** **** *** *** **** *** * ++ + | *** **** *** *** **** *** *** **** *** *** **** *** *** **** *** * | + | *** **** *** *** **** *** *** **** *** *** **** *** *** **** *** * | + | *** **** *** *** **** *** *** **** *** *** **** *** *** **** *** * | + | ***** **** *** *** **** *** *** **** *** *** **** *** *** **** *** * | + | * *** **** *** *** **** *** *** **** *** *** **** *** *** **** *** * | + + *+*** **** ***+*** **** ***+*** **** ***+*** **** ***+*** **** ***+* + + 0 ++----------********************************************-********+***-****-*****----------++ + -500 0 500 1000 1500 2000 2500 3000 EOF @@ -689,43 +689,43 @@ tryplot( testname => 'Circles', refplot => <<'EOF' ); - 5 ++-+--+--+--+--+--+--+--*--+-** - + + + + + + + + * + *+ - | * *| - | ******| - 4.5 ++ ++ - | | - | | - | * | - | **** | - 4 ++ * ** ++ - | * * | - | **** | - | | - 3.5 ++ ++ - | | - | * | - | **** | - 3 ++ * ** ++ - | * * | - | **** | - | | - | | - 2.5 ++ ++ - | | - | | - | * | - 2 ++ *** ++ - | ** | - | | - | | - | | - 1.5 ++ ++ - | | - | | - + * + + + + + + + + + - 1 ++***-+--+--+--+--+--+--+--+-++ - 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 + 5 ++-------+--------+--------+--------+--------+--------+--------+--------*--------+-------** + + + + + + + + + * + *+ + | * * *| + | ******** * *| + 4.5 ++ ** ** * *+ + | ** ** ** **| + | ** ** ** ** | + | * * ** ** | + | * * ** ** | + 4 ++ * ** ********** ++ + | * * | + | * * | + | * * * | + 3.5 ++ ****** ** ** ++ + | * * ** ** | + | * * ** ** | + | * * ******** | + 3 ++ * ** ++ + | * * | + | * * | + | * * | + | * * | + 2.5 ++ * ****** ++ + | ****** | + | ** ** | + | * * | + 2 ++ * ** ++ + | * ** | + | * * | + | ** ** | + | ****** | + 1.5 ++ ++ + | | + | * | + + **** + + + + + + + + + + 1 ++-----*-+**------+--------+--------+--------+--------+--------+--------+--------+-------++ + 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 EOF @@ -736,43 +736,43 @@ tryplot( testname => 'Error bars (using extraValuesPerPoint)', refplot => <<'EOF' ); - 5.5 ++--+---+--+---+---+---+--+--*** - + + + + + + + + * - | * - 5 ++ +A - | * - | * - | * - 4.5 ++ *** - | *** | - | * | - 4 ++ A ++ - | * | - | * | - | *** | - 3.5 ++ ++ - | *** | - | * | - 3 ++ A ++ - | * | - | * | - | *** | - 2.5 ++ ++ - | | - | *** | - 2 ++ A ++ - | * | - | *** | - | | - 1.5 ++ ++ - | | - | | - 1*A* ++ - *** | - | | - + + + + + + + + + - 0.5 ++--+---+--+---+---+---+--+--++ - 1 1.5 2 2.5 3 3.5 4 4.5 5 + 5.5 ++---------+-----------+----------+----------+----------+-----------+----------+---------*** + + + + + + + + + * + | * + 5 ++ +A + | * + | * + | * + 4.5 ++ *** + | *** | + | * | + 4 ++ A ++ + | * | + | * | + | *** | + 3.5 ++ ++ + | *** | + | * | + 3 ++ A ++ + | * | + | * | + | *** | + 2.5 ++ ++ + | | + | *** | + 2 ++ A ++ + | * | + | *** | + | | + 1.5 ++ ++ + | | + | | + 1*A* ++ + *** | + | | + + + + + + + + + + + 0.5 ++---------+-----------+----------+----------+----------+-----------+----------+---------++ + 1 1.5 2 2.5 3 3.5 4 4.5 5 EOF @@ -782,43 +782,43 @@ tryplot( testname => 'Monotonicity check', refplot => <<'EOF' ); - 10 ++--+---+--+---+---+---+--+--+A - + + + + + + + + *+ - | * | - | * | - 9.5 ++ * ++ - | * | - | * | - | * | - | * | - 9 ++ A ++ - | * | - | * | - | * | - 8.5 ++ * ++ - | * | - | * | - | * | - 8 ++ A ++ - | * | - | * | - | * | - | * | - 7.5 ++ * ++ - | * | - | * | - | * | - 7 ++ A ++ - | * | - | * | - | * | - | * | - 6.5 ++ * ++ - | * | - | * | - +* + + + + + + + + - 6 A+--+---+--+---+---+---+--+--++ - 0 0.5 1 1.5 2 2.5 3 3.5 4 + 10 ++---------+-----------+----------+----------+----------+-----------+----------+---------*A + + + + + + + + + ** + + | *** | + | ** | + 9.5 ++ *** ++ + | ** | + | ** | + | *** | + | ** | + 9 ++ *A* ++ + | *** | + | *** | + | *** | + 8.5 ++ ** ++ + | *** | + | *** | + | *** | + 8 ++ *A* ++ + | ** | + | *** | + | ** | + | *** | + 7.5 ++ ** ++ + | ** | + | *** | + | ** | + 7 ++ *A* ++ + | ** | + | *** | + | ** | + | *** | + 6.5 ++ *** ++ + | ** | + | *** | + + ** + + + + + + + + + 6 A*---------+-----------+----------+----------+----------+-----------+----------+---------++ + 0 0.5 1 1.5 2 2.5 3 3.5 4 EOF @@ -829,43 +829,43 @@ tryplot( testname => 'basic --timefmt plot', refplot => <<'EOF' ); - 5 ++--+---+--+---+---+---+--+--+A - + + + + + + + + + - | | - | | - 4.5 ++ ++ - | | - | | - | | - | | - 4 ++ A ++ - | | - | | - | | - 3.5 ++ ++ - | | - | | - | | - 3 ++ A ++ - | | - | | - | | - | | - 2.5 ++ ++ - | | - | | - | | - 2 ++ A ++ - | | - | | - | | - | | - 1.5 ++ ++ - | | - | | - + + + + + + + + + - 1 A+--+---+--+---+---+---+--+--++ - 05:085:085:09:095:105:105:11:115:12 + 5 ++---------+-----------+----------+----------+----------+-----------+----------+---------+A + + + + + + + + + + + | | + | | + 4.5 ++ ++ + | | + | | + | | + | | + 4 ++ A ++ + | | + | | + | | + 3.5 ++ ++ + | | + | | + | | + 3 ++ A ++ + | | + | | + | | + | | + 2.5 ++ ++ + | | + | | + | | + 2 ++ A ++ + | | + | | + | | + | | + 1.5 ++ ++ + | | + | | + + + + + + + + + + + 1 A+---------+-----------+----------+----------+----------+-----------+----------+---------++ + 05:08 05:08 05:09 05:09 05:10 05:10 05:11 05:11 05:12 EOF @@ -877,43 +877,43 @@ tryplot( testname => '--timefmt plot with bounds', refplot => <<'EOF' ); - 5 ++++-++-++-++-++-+A-++-++-++-++ - + + + + + - | | - | | - 4.5 ++ ++ - | | - | | - | | - | | - 4 ++ A ++ - | | - | | - | | - 3.5 ++ ++ - | | - | | - | | - 3 ++ A ++ - | | - | | - | | - | | - 2.5 ++ ++ - | | - | | - | | - 2 ++ A ++ - | | - | | - | | - | | - 1.5 ++ ++ - | | - | | - + + + + + - 1 ++++-++-++-+A-++-++-++-++-++-++ - 05:00 05:05 05:10 05:15 05:20 + 5 ++---+---+----+---+----+---+----+---+----+---+----+---A----+---+----+---+----+---+----+--++ + + + + + + + | | + | | + 4.5 ++ ++ + | | + | | + | | + | | + 4 ++ A ++ + | | + | | + | | + 3.5 ++ ++ + | | + | | + | | + 3 ++ A ++ + | | + | | + | | + | | + 2.5 ++ ++ + | | + | | + | | + 2 ++ A ++ + | | + | | + | | + | | + 1.5 ++ ++ + | | + | | + + + + + + + 1 ++---+---+----+---+----+---+----+---A----+---+----+---+----+---+----+---+----+---+----+--++ + 05:00 05:05 05:10 05:15 05:20 EOF @@ -924,43 +924,43 @@ tryplot( testname => '--timefmt plot with --monotonic', refplot => <<'EOF' ); - 10 ++--+---+--+---+---+---+--+--+A - + + + + + + + + + - | | - | | - 9.5 ++ ++ - | | - | | - | | - | | - 9 ++ A ++ - | | - | | - | | - 8.5 ++ ++ - | | - | | - | | - 8 ++ A ++ - | | - | | - | | - | | - 7.5 ++ ++ - | | - | | - | | - 7 ++ A ++ - | | - | | - | | - | | - 6.5 ++ ++ - | | - | | - + + + + + + + + + - 6 A+--+---+--+---+---+---+--+--++ - 05:075:075:08:085:095:095:10:105:11 + 10 ++---------+-----------+----------+----------+----------+-----------+----------+---------+A + + + + + + + + + + + | | + | | + 9.5 ++ ++ + | | + | | + | | + | | + 9 ++ A ++ + | | + | | + | | + 8.5 ++ ++ + | | + | | + | | + 8 ++ A ++ + | | + | | + | | + | | + 7.5 ++ ++ + | | + | | + | | + 7 ++ A ++ + | | + | | + | | + | | + 6.5 ++ ++ + | | + | | + + + + + + + + + + + 6 A+---------+-----------+----------+----------+----------+-----------+----------+---------++ + 05:07 05:07 05:08 05:08 05:09 05:09 05:10 05:10 05:11 EOF @@ -978,83 +978,83 @@ tryplot( testname => 'basic streaming test', refplot => <<'EOF' ); - 1 ++----+-----+-----+-----+----+A - + + + + + *+ - | * | - | * | - | * | - | * | - | * | - 0.8 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 0.6 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 0.4 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 0.2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - +* + + + + + - 0 A+----+-----+-----+-----+----++ - 1 1.2 1.4 1.6 1.8 2 + 1 ++----------------+-----------------+-----------------+-----------------+----------------*A + + + + + + ** + + | *** | + | *** | + | ** | + | *** | + | ** | + 0.8 ++ *** ++ + | ** | + | *** | + | *** | + | ** | + | *** | + | ** | + 0.6 ++ *** ++ + | ** | + | *** | + | *** | + | ** | + | *** | + | ** | + 0.4 ++ *** ++ + | ** | + | *** | + | *** | + | ** | + | *** | + | ** | + 0.2 ++ *** ++ + | ** | + | *** | + | *** | + | ** | + | *** | + + ** + + + + + + 0 A*----------------+-----------------+-----------------+-----------------+----------------++ + 1 1.2 1.4 1.6 1.8 2 - 2 ++------+------+-------+-----+A - + + + + *+ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - 1.5 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - 1 ++ A ++ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - | * | - 0.5 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - +* + + + + - 0 A+------+------+-------+-----++ - 1 1.5 2 2.5 3 + 2 ++---------------------+---------------------+----------------------+--------------------*A + + + + + ** + + | *** | + | *** | + | ** | + | *** | + | *** | + | ** | + | *** | + 1.5 ++ *** ++ + | ** | + | *** | + | *** | + | ** | + | *** | + | *** | + | ** | + 1 ++ *A* ++ + | ** | + | *** | + | ** | + | *** | + | ** | + | *** | + | ** | + | *** | + 0.5 ++ ** ++ + | *** | + | ** | + | *** | + | ** | + | *** | + | ** | + | *** | + + ** + + + + + 0 A*---------------------+---------------------+----------------------+--------------------++ + 1 1.5 2 2.5 3 EOF @@ -1064,83 +1064,83 @@ tryplot( testname => 'basic streaming test, twice as fast', refplot => <<'EOF' ); - 1 ++----+-----+-----+-----+----+A - + + + + + *+ - | * | - | * | - | * | - | * | - | * | - 0.8 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 0.6 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 0.4 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 0.2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - +* + + + + + - 0 A+----+-----+-----+-----+----++ - 1 1.2 1.4 1.6 1.8 2 + 1 ++----------------+-----------------+-----------------+-----------------+----------------*A + + + + + + ** + + | *** | + | *** | + | ** | + | *** | + | ** | + 0.8 ++ *** ++ + | ** | + | *** | + | *** | + | ** | + | *** | + | ** | + 0.6 ++ *** ++ + | ** | + | *** | + | *** | + | ** | + | *** | + | ** | + 0.4 ++ *** ++ + | ** | + | *** | + | *** | + | ** | + | *** | + | ** | + 0.2 ++ *** ++ + | ** | + | *** | + | *** | + | ** | + | *** | + + ** + + + + + + 0 A*----------------+-----------------+-----------------+-----------------+----------------++ + 1 1.2 1.4 1.6 1.8 2 - 2 ++------+------+-------+-----+A - + + + + *+ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - 1.5 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - 1 ++ A ++ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - | * | - 0.5 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - +* + + + + - 0 A+------+------+-------+-----++ - 1 1.5 2 2.5 3 + 2 ++---------------------+---------------------+----------------------+--------------------*A + + + + + ** + + | *** | + | *** | + | ** | + | *** | + | *** | + | ** | + | *** | + 1.5 ++ *** ++ + | ** | + | *** | + | *** | + | ** | + | *** | + | *** | + | ** | + 1 ++ *A* ++ + | ** | + | *** | + | ** | + | *** | + | ** | + | *** | + | ** | + | *** | + 0.5 ++ ** ++ + | *** | + | ** | + | *** | + | ** | + | *** | + | ** | + | *** | + + ** + + + + + 0 A*---------------------+---------------------+----------------------+--------------------++ + 1 1.5 2 2.5 3 EOF @@ -1151,83 +1151,83 @@ tryplot( testname => 'streaming with --xlen', refplot => <<'EOF' ); - 1 ++-+----+-----+----+-----+---+A - | + + + + + *+ - | * | - | * | - | * | - | * | - | * | - 0.8 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 0.6 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 0.4 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 0.2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | +* + + + + + - 0 ++-A----+-----+----+-----+---++ - 1 1.2 1.4 1.6 1.8 2 + 1 ++------+----------------+---------------+---------------+----------------+--------------*A + | + + + + + ** + + | ** | + | *** | + | ** | + | ** | + | *** | + 0.8 ++ ** ++ + | ** | + | *** | + | ** | + | ** | + | *** | + | ** | + 0.6 ++ ** ++ + | *** | + | ** | + | *** | + | ** | + | ** | + | *** | + 0.4 ++ ** ++ + | ** | + | *** | + | ** | + | ** | + | *** | + | ** | + 0.2 ++ ** ++ + | *** | + | ** | + | ** | + | *** | + | ** | + | + ** + + + + + + 0 ++------A*---------------+---------------+---------------+----------------+--------------++ + 1 1.2 1.4 1.6 1.8 2 - 2 ++-+----+-----+----+-----+---+A - | + + + + + *+ - | * | - | * | - | * | - | * | - | * | - 1.8 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 1.6 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 1.4 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 1.2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | +* + + + + + - 1 ++-A----+-----+----+-----+---++ - 2 2.2 2.4 2.6 2.8 3 + 2 ++------+----------------+---------------+---------------+----------------+--------------*A + | + + + + + ** + + | ** | + | *** | + | ** | + | ** | + | *** | + 1.8 ++ ** ++ + | ** | + | *** | + | ** | + | ** | + | *** | + | ** | + 1.6 ++ ** ++ + | *** | + | ** | + | *** | + | ** | + | ** | + | *** | + 1.4 ++ ** ++ + | ** | + | *** | + | ** | + | ** | + | *** | + | ** | + 1.2 ++ ** ++ + | *** | + | ** | + | ** | + | *** | + | ** | + | + ** + + + + + + 1 ++------A*---------------+---------------+---------------+----------------+--------------++ + 2 2.2 2.4 2.6 2.8 3 EOF @@ -1237,403 +1237,403 @@ tryplot( testname => 'streaming with --monotonic', refplot => <<'EOF' ); - 1 ++----+-----+-----+-----+----+A - + + + + + *+ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - 0.5 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - | * | - -0.5 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - +* + + + + + - -1 A+----+-----+-----+-----+----++ - -1 -0.8 -0.6 -0.4 -0.2 0 + 1 ++----------------+-----------------+-----------------+-----------------+----------------*A + + + + + + ** + + | *** | + | *** | + | ** | + | *** | + | ** | + | *** | + | ** | + 0.5 ++ *** ++ + | *** | + | ** | + | *** | + | ** | + | *** | + | ** | + | *** | + 0 ++ *** ++ + | ** | + | *** | + | ** | + | *** | + | ** | + | *** | + | *** | + | ** | + -0.5 ++ *** ++ + | ** | + | *** | + | ** | + | *** | + | *** | + | ** | + | *** | + + ** + + + + + + -1 A*----------------+-----------------+-----------------+-----------------+----------------++ + -1 -0.8 -0.6 -0.4 -0.2 0 - 2 ++------+------+-------+-----+A - + + + + *+ - | ** | - | * | - | * | - | * | - 1.5 ++ ** ++ - | * | - | * | - | * | - | ** | - | * | - 1 ++ A ++ - | * | - | * | - | * | - | * | - 0.5 ++ * ++ - | * | - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - | * | - -0.5 ++ * ++ - | * | - | * | - | * | - |* | - +* + + + + - -1 A+------+------+-------+-----++ - -1 -0.5 0 0.5 1 + 2 ++---------------------+---------------------+----------------------+--------------------*A + + + + + **** + + | **** | + | **** | + | *** | + | **** | + 1.5 ++ **** ++ + | **** | + | *** | + | **** | + | **** | + | **** | + 1 ++ A* ++ + | ** | + | ** | + | ** | + | ** | + 0.5 ++ ** ++ + | ** | + | ** | + | ** | + | ** | + | ** | + 0 ++ ** ++ + | ** | + | ** | + | ** | + | ** | + | ** | + -0.5 ++ ** ++ + | ** | + | ** | + | ** | + | ** | + +** + + + + + -1 A+---------------------+---------------------+----------------------+--------------------++ + -1 -0.5 0 0.5 1 - 3 ++---+----+----+----+----+---+A - + + + + + + *+ - | * | - | * | - 2.5 ++ ** ++ - | * | - | * | - | * | - | * | - 2 ++ A ++ - | * | - | ** | - | * | - 1.5 ++ * ++ - | * | - | ** | - | * | - 1 ++ A ++ - | * | - | * | - | * | - | * | - 0.5 ++ * ++ - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - -0.5 ++* ++ - | * | - |* | - +* + + + + + + - -1 A+---+----+----+----+----+---++ - -1 -0.5 0 0.5 1 1.5 2 + 3 ++-------------+--------------+--------------+--------------+--------------+-------------*A + + + + + + + **** + + | *** | + | *** | + 2.5 ++ **** ++ + | *** | + | *** | + | **** | + | *** | + 2 ++ *A* ++ + | **** | + | **** | + | **** | + 1.5 ++ *** ++ + | **** | + | **** | + | **** | + 1 ++ A* ++ + | ** | + | ** | + | * | + | ** | + 0.5 ++ ** ++ + | * | + | ** | + | ** | + 0 ++ * ++ + | ** | + | ** | + | * | + | ** | + -0.5 ++ ** ++ + | * | + | ** | + +** + + + + + + + -1 A+-------------+--------------+--------------+--------------+--------------+-------------++ + -1 -0.5 0 0.5 1 1.5 2 - 4 ++--+---+---+---+---+---+---+--+A - + + + + + + + + *+ - | * | - | ** | - | * | - | * | - | * | - 3 ++ A ++ - | * | - | * | - | ** | - | * | - | * | - | * | - 2 ++ A ++ - | * | - | * | - | ** | - | * | - | * | - | * | - 1 ++ A ++ - | * | - | * | - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - |* | - +* + + + + + + + + - -1 A+--+---+---+---+---+---+---+--++ - -1 -0.5 0 0.5 1 1.5 2 2.5 3 + 4 ++----------+----------+-----------+----------+-----------+----------+-----------+---------*A + + + + + + + + + *** + + | **** | + | *** | + | *** | + | **** | + | *** | + 3 ++ *A* ++ + | *** | + | **** | + | *** | + | *** | + | **** | + | *** | + 2 ++ *A* ++ + | *** | + | **** | + | *** | + | *** | + | **** | + | *** | + 1 ++ A* ++ + | ** | + | ** | + | * | + | ** | + | ** | + | * | + 0 ++ ** ++ + | * | + | ** | + | ** | + | * | + | ** | + +** + + + + + + + + + -1 A+----------+----------+-----------+----------+-----------+----------+-----------+---------++ + -1 -0.5 0 0.5 1 1.5 2 2.5 3 - 5 ++----+------+-----+------+----+A - + + + + + *+ - | * | - | * | - | * | - | * | - 4 ++ A ++ - | * | - | * | - | ** | - | * | - | * | - 3 ++ A ++ - | * | - | ** | - | * | - | * | - 2 ++ A ++ - | * | - | * | - | ** | - | * | - | * | - 1 ++ A ++ - | * | - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - |* | - +* + + + + + - -1 A+----+------+-----+------+----++ - -1 0 1 2 3 4 + 5 ++----------------+------------------+-----------------+------------------+----------------*A + + + + + + *** + + | *** | + | *** | + | *** | + | *** | + 4 ++ *A* ++ + | *** | + | *** | + | **** | + | *** | + | *** | + 3 ++ *A* ++ + | **** | + | **** | + | *** | + | **** | + 2 ++ *A* ++ + | *** | + | *** | + | **** | + | *** | + | *** | + 1 ++ A* ++ + | ** | + | * | + | ** | + | * | + | ** | + 0 ++ * ++ + | ** | + | * | + | ** | + | * | + +** + + + + + + -1 A+----------------+------------------+-----------------+------------------+----------------++ + -1 0 1 2 3 4 - 6 ++----+------+-----+------+----+A - + + + + + *+ - | * | - | * | - | * | - 5 ++ * ++ - | * | - | * | - | * | - | * | - 4 ++ * ++ - | * | - | * | - | * | - | * | - 3 ++ * ++ - | * | - | * | - | * | - | * | - 2 ++ * ++ - | * | - | * | - | * | - | * | - 1 ++ * ++ - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - +* + + + + + - -1 A+----+------+-----+------+----++ - -1 -0.8 -0.6 -0.4 -0.2 0 + 6 ++----------------+------------------+-----------------+------------------+----------------*A + + + + + + ** + + | *** | + | *** | + | ** | + 5 ++ *** ++ + | *** | + | ** | + | *** | + | ** | + 4 ++ *** ++ + | *** | + | ** | + | *** | + | *** | + 3 ++ ** ++ + | *** | + | *** | + | ** | + | *** | + 2 ++ ** ++ + | *** | + | *** | + | ** | + | *** | + 1 ++ *** ++ + | ** | + | *** | + | ** | + | *** | + 0 ++ *** ++ + | ** | + | *** | + | *** | + + ** + + + + + + -1 A*----------------+------------------+-----------------+------------------+----------------++ + -1 -0.8 -0.6 -0.4 -0.2 0 - 7 ++------+-------+-------+-----**A - + + + + **** + - | **** | - | **** | - 6 ++ A* ++ - | * | - | * | - | * | - | * | - 5 ++ * ++ - | * | - | * | - | * | - 4 ++ * ++ - | * | - | * | - | * | - 3 ++ * ++ - | * | - | * | - | * | - | * | - 2 ++ * ++ - | * | - | * | - | * | - 1 ++ * ++ - | * | - | * | - | * | - | * | - 0 ++* ++ - | * | - |* | - +* + + + + - -1 A+------+-------+-------+------++ - -1 -0.5 0 0.5 1 + 7 ++---------------------+----------------------+----------------------+-----------------*****A + + + + + ************ + + | *********** | + | ************ | + 6 ++ A***** ++ + | ** | + | * | + | ** | + | * | + 5 ++ ** ++ + | * | + | ** | + | * | + 4 ++ ** ++ + | * | + | ** | + | * | + 3 ++ ** ++ + | * | + | ** | + | * | + | * | + 2 ++ ** ++ + | * | + | ** | + | * | + 1 ++ ** ++ + | * | + | ** | + | * | + | ** | + 0 ++ * ++ + | ** | + | * | + +** + + + + + -1 A+---------------------+----------------------+----------------------+---------------------++ + -1 -0.5 0 0.5 1 - 8 ++---+-----+----+----+-----+---*A - + + + + + +*** + - | ** | - | *** | - 7 ++ *A* ++ - | ** | - | *** | - | ** | - 6 ++ A* ++ - | * | - | * | - | * | - 5 ++ * ++ - | * | - | * | - | * | - 4 ++ * ++ - | * | - | * | - 3 ++ * ++ - | * | - | * | - | * | - 2 ++ * ++ - | * | - | * | - | * | - 1 ++ * ++ - | * | - | * | - | * | - 0 ++* ++ - |* | - |* | - * + + + + + + - -1 A+---+-----+----+----+-----+---++ - -1 -0.5 0 0.5 1 1.5 2 + 8 ++-------------+---------------+--------------+--------------+---------------+-----------***A + + + + + + + ******** + + | ******** | + | ******** | + 7 ++ ***A*** ++ + | ******** | + | ******* | + | ******** | + 6 ++ A*** ++ + | * | + | * | + | ** | + 5 ++ * ++ + | * | + | * | + | * | + 4 ++ * ++ + | * | + | ** | + 3 ++ * ++ + | * | + | * | + | * | + 2 ++ * ++ + | * | + | ** | + | * | + 1 ++ * ++ + | * | + | * | + | * | + 0 ++ * ++ + | ** | + | * | + +* + + + + + + + -1 A+-------------+---------------+--------------+--------------+---------------+-------------++ + -1 -0.5 0 0.5 1 1.5 2 - 10 ++--+---+---+---+--+---+---+--++ - + + + + + + + + + - | | - | *A - | *** | - | ** | - 8 ++ *A* ++ - | ** | - | ** | - | *A* | - | *** | - | ** | - 6 ++ A* ++ - | * | - | * | - | * | - | * | - 4 ++ * ++ - | * | - | * | - | * | - | * | - | * | - 2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - 0 +* ++ - |* | - * | - A | - | | - + + + + + + + + + - -2 ++--+---+---+---+--+---+---+--++ - -1 -0.5 0 0.5 1 1.5 2 2.5 3 + 10 ++---------+-----------+----------+-----------+----------+----------+-----------+---------++ + + + + + + + + + + + | | + | ***A + | ******** | + | ******** | + 8 ++ ***A*** ++ + | ******** | + | ******* | + | ***A*** | + | ******** | + | ******** | + 6 ++ A*** ++ + | * | + | * | + | ** | + | * | + 4 ++ * ++ + | * | + | * | + | * | + | * | + | ** | + 2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + 0 ++ ** ++ + | * | + |* | + A | + | | + + + + + + + + + + + -2 ++---------+-----------+----------+-----------+----------+----------+-----------+---------++ + -1 -0.5 0 0.5 1 1.5 2 2.5 3 - 10 ++----+-----+------+-----+----*A - + + + + + ** + - | ** | - | *A | - | ** | - | ** | - 8 ++ *A ++ - | ** | - | ** | - | *A* | - | ** | - | ** | - 6 ++ A ++ - | * | - | * | - | * | - | * | - 4 ++ * ++ - | * | - | * | - | * | - | * | - | * | - 2 ++ * ++ - | * | - | * | - | * | - | * | - |* | - 0 +* ++ - |* | - * | - A | - | | - + + + + + + - -2 ++----+-----+------+-----+----++ - -1 0 1 2 3 4 + 10 ++----------------+-----------------+------------------+-----------------+--------------***A + + + + + + ****** + + | ****** | + | ***A** | + | ****** | + | ****** | + 8 ++ ***A** ++ + | ****** | + | ****** | + | ***A*** | + | ****** | + | ****** | + 6 ++ A** ++ + | * | + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + |* | + A | + | | + + + + + + + + -2 ++----------------+-----------------+------------------+-----------------+----------------++ + -1 0 1 2 3 4 EOF @@ -1645,83 +1645,83 @@ tryplot( testname => '--timefmt streaming plot with --xlen', refplot => <<'EOF' ); - 1 ++---+-----+----+----+-----+---+A - + + + + + + *+ - | *| - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - -1 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - -2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - -3 ++ * ++ - | * | - | * | - | * | - | * | - | * | - + + +* + + + + - -4 ++---+-----A----+----+-----+---++ - 05:0505:05 05:0605:0605:07 05:0705:08 + 1 ++-------------+---------------+--------------+--------------+---------------+-------------+A + + + + + + + **+ + | ** | + | ** | + | * | + | ** | + | ** | + 0 ++ ** ++ + | * | + | ** | + | ** | + | ** | + | * | + | ** | + -1 ++ ** ++ + | ** | + | * | + | ** | + | ** | + | * | + | ** | + -2 ++ ** ++ + | ** | + | * | + | ** | + | ** | + | ** | + | * | + -3 ++ ** ++ + | ** | + | ** | + | * | + | ** | + | ** | + + + +** + + + + + -4 ++-------------+---------------A--------------+--------------+---------------+-------------++ + 05:05 05:05 05:06 05:06 05:07 05:07 05:08 - 2 ++---+-----+----+----+-----+---+A - + + + + + + **+ - | ** | - | ** | - | ** | - | ** | - 1 ++ A ++ - | * | - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - -1 ++ * ++ - | * | - | * | - | * | - | * | - | * | - -2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - -3 ++ * ++ - | * | - | * | - | * | - |* | - +* + + + + + + - -4 A+---+-----+----+----+-----+---++ - 05:0605:06 05:0705:0705:08 05:0805:09 + 2 ++-------------+---------------+--------------+--------------+---------------+------------**A + + + + + + + ***** + + | ***** | + | ****** | + | ***** | + | ***** | + 1 ++ *A** ++ + | ** | + | ** | + | ** | + | ** | + | ** | + 0 ++ ** ++ + | ** | + | ** | + | ** | + | *** | + -1 ++ ** ++ + | ** | + | ** | + | ** | + | ** | + | ** | + -2 ++ ** ++ + | ** | + | *** | + | ** | + | ** | + | ** | + -3 ++ ** ++ + | ** | + | ** | + | ** | + | ** | + + ** + + + + + + + -4 A*-------------+---------------+--------------+--------------+---------------+-------------++ + 05:06 05:06 05:07 05:07 05:08 05:08 05:09 EOF @@ -1733,403 +1733,403 @@ tryplot( testname => '--timefmt streaming plot with --monotonic', refplot => <<'EOF' ); - 1 ++----+------+-----+------+----+A - + + + + + *+ - | * | - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - -1 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - -2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - -3 ++ * ++ - | * | - | * | - | * | - | * | - | * | - +* + + + + + - -4 A+----+------+-----+------+----++ - 05:06 05:06 05:06 05:06 05:06 05:07 + 1 ++----------------+------------------+-----------------+------------------+----------------*A + + + + + + ** + + | *** | + | *** | + | ** | + | *** | + | *** | + 0 ++ ** ++ + | *** | + | ** | + | *** | + | *** | + | ** | + | *** | + -1 ++ *** ++ + | ** | + | *** | + | *** | + | ** | + | *** | + | ** | + -2 ++ *** ++ + | *** | + | ** | + | *** | + | *** | + | ** | + | *** | + -3 ++ ** ++ + | *** | + | *** | + | ** | + | *** | + | *** | + + ** + + + + + + -4 A*----------------+------------------+-----------------+------------------+----------------++ + 05:06 05:06 05:06 05:06 05:06 05:07 - 2 ++------+-------+-------+------*A - + + + + *** + - | ** | - | *** | - | *** | - | ** | - 1 ++ A* ++ - | * | - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - -1 ++ * ++ - | * | - | * | - | * | - | * | - | * | - -2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - -3 ++ * ++ - | * | - | * | - | * | - |* | - +* + + + + - -4 A+------+-------+-------+------++ - 05:06 05:06 05:07 05:07 05:08 + 2 ++---------------------+----------------------+----------------------+-------------------***A + + + + + ******** + + | ******** | + | ******* | + | ******** | + | ******** | + 1 ++ A*** ++ + | ** | + | * | + | ** | + | ** | + | * | + 0 ++ ** ++ + | * | + | ** | + | ** | + | * | + -1 ++ ** ++ + | * | + | ** | + | ** | + | * | + | ** | + -2 ++ * ++ + | ** | + | * | + | ** | + | ** | + | * | + -3 ++ ** ++ + | * | + | ** | + | ** | + | * | + +** + + + + + -4 A+---------------------+----------------------+----------------------+---------------------++ + 05:06 05:06 05:07 05:07 05:08 - 3 ++---+-----+----+----+-----+---*A - + + + + + + ** + - | ** | - | ** | - | ** | - 2 ++ *A* ++ - | ** | - | ** | - | ** | - | ** | - 1 ++ A ++ - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - -1 ++ * ++ - | * | - | * | - | * | - | * | - -2 ++ * ++ - | * | - | * | - | * | - | * | - -3 ++* ++ - | * | - |* | - |* | - * + + + + + + - -4 A+---+-----+----+----+-----+---++ - 05:0605:06 05:0705:0705:08 05:0805:09 + 3 ++-------------+---------------+--------------+--------------+---------------+-----------***A + + + + + + + ****** + + | ****** | + | ****** | + | ****** | + 2 ++ ***A*** ++ + | ****** | + | ****** | + | ****** | + | ****** | + 1 ++ A** ++ + | * | + | ** | + | * | + | * | + 0 ++ * ++ + | ** | + | * | + | * | + | * | + -1 ++ ** ++ + | * | + | * | + | * | + | * | + -2 ++ ** ++ + | * | + | * | + | * | + | ** | + -3 ++ * ++ + | * | + | * | + | ** | + +* + + + + + + + -4 A+-------------+---------------+--------------+--------------+---------------+-------------++ + 05:06 05:06 05:07 05:07 05:08 05:08 05:09 - 4 ++--+---+---+---+---+---+---+--*A - + + + + + + + +** + - | ** | - | ** | - 3 ++ A ++ - | ** | - | ** | - | * | - | ** | - 2 ++ *A ++ - | ** | - | ** | - | ** | - 1 ++ A ++ - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - -1 ++ * ++ - | * | - | * | - | * | - -2 ++ * ++ - | * | - | * | - | * | - | * | - -3 +* ++ - |* | - |* | - * + + + + + + + + - -4 A+--+---+---+---+---+---+---+--++ - 05:065:065:075:075:085:085:095:095:10 + 4 ++----------+----------+-----------+----------+-----------+----------+-----------+--------**A + + + + + + + + + ****** + + | ****** | + | ****** | + 3 ++ **A** ++ + | **** | + | ***** | + | ***** | + | **** | + 2 ++ **A** ++ + | ****** | + | ****** | + | ****** | + 1 ++ A** ++ + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + -1 ++ * ++ + | * | + | ** | + | * | + -2 ++ * ++ + | * | + | * | + | * | + | * | + -3 ++ * ++ + | * | + | * | + +* + + + + + + + + + -4 A+----------+----------+-----------+----------+-----------+----------+-----------+---------++ + 05:06 05:06 05:07 05:07 05:08 05:08 05:09 05:09 05:10 - 5 ++----+------+-----+------+----+A - + + + + + **+ - | * | - | ** | - 4 ++ A ++ - | ** | - | ** | - | ** | - 3 ++ A ++ - | ** | - | * | - | ** | - 2 ++ A ++ - | ** | - | ** | - | ** | - 1 ++ A ++ - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - -1 ++ * ++ - | * | - | * | - | * | - -2 ++ * ++ - | * | - | * | - | * | - -3 +* ++ - |* | - |* | - * + + + + + - -4 A+----+------+-----+------+----++ - 05:06 05:07 05:08 05:09 05:10 05:11 + 5 ++----------------+------------------+-----------------+------------------+---------------**A + + + + + + **** + + | ***** | + | **** | + 4 ++ **A** ++ + | ***** | + | **** | + | ***** | + 3 ++ **A** ++ + | **** | + | ***** | + | **** | + 2 ++ **A** ++ + | ***** | + | **** | + | ***** | + 1 ++ A** ++ + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + -1 ++ * ++ + | * | + | * | + | * | + -2 ++ * ++ + | * | + | * | + | * | + -3 ++ * ++ + | * | + | * | + +* + + + + + + -4 A+----------------+------------------+-----------------+------------------+----------------++ + 05:06 05:07 05:08 05:09 05:10 05:11 - 6 ++----+------+-----+------+----+A - + + + + + *+ - | * | - | * | - | * | - | * | - | * | - 4 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - | * | - | * | - -2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - +* + + + + + - -4 A+----+------+-----+------+----++ - 05:06 05:06 05:06 05:06 05:06 05:07 + 6 ++----------------+------------------+-----------------+------------------+----------------*A + + + + + + ** + + | *** | + | *** | + | ** | + | *** | + | *** | + 4 ++ ** ++ + | *** | + | ** | + | *** | + | *** | + | ** | + | *** | + 2 ++ *** ++ + | ** | + | *** | + | *** | + | ** | + | *** | + | ** | + 0 ++ *** ++ + | *** | + | ** | + | *** | + | *** | + | ** | + | *** | + -2 ++ ** ++ + | *** | + | *** | + | ** | + | *** | + | *** | + + ** + + + + + + -4 A*----------------+------------------+-----------------+------------------+----------------++ + 05:06 05:06 05:06 05:06 05:06 05:07 - 8 ++------+-------+-------+------++ - + + + + + - | | - | **A - | ****** | - | ***** | - 6 ++ A** ++ - | * | - | * | - | * | - | * | - | * | - 4 ++ * ++ - | * | - | * | - | * | - | * | - 2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - | * | - -2 ++ * ++ - | * | - | * | - | * | - |* | - +* + + + + - -4 A+------+-------+-------+------++ - 05:06 05:06 05:07 05:07 05:08 + 8 ++---------------------+----------------------+----------------------+---------------------++ + + + + + + + | | + | *******A + | **************** | + | *************** | + 6 ++ A******* ++ + | ** | + | * | + | ** | + | ** | + | * | + 4 ++ ** ++ + | * | + | ** | + | ** | + | * | + 2 ++ ** ++ + | * | + | ** | + | ** | + | * | + | ** | + 0 ++ * ++ + | ** | + | * | + | ** | + | ** | + | * | + -2 ++ ** ++ + | * | + | ** | + | ** | + | * | + +** + + + + + -4 A+---------------------+----------------------+----------------------+---------------------++ + 05:06 05:06 05:07 05:07 05:08 - 8 ++---+-----+----+----+-----+---*A - + + + + + **** + - | **** | - | *A* | - | **** | - | *** | - 6 ++ A* ++ - | * | - | * | - | * | - | * | - | * | - 4 ++ * ++ - | * | - | * | - | * | - | * | - 2 ++ * ++ - | * | - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - | * | - -2 ++* ++ - | * | - | * | - |* | - |* | - * + + + + + + - -4 A+---+-----+----+----+-----+---++ - 05:0605:06 05:0705:0705:08 05:0805:09 + 8 ++-------------+---------------+--------------+--------------+---------------+---------*****A + + + + + + ********** + + | ********** | + | *****A***** | + | ********** | + | ********** | + 6 ++ A**** ++ + | * | + | * | + | * | + | * | + | * | + 4 ++ * ++ + | ** | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + | ** | + -2 ++ * ++ + | * | + | * | + | * | + | * | + +* + + + + + + + -4 A+-------------+---------------+--------------+--------------+---------------+-------------++ + 05:06 05:06 05:07 05:07 05:08 05:08 05:09 - 10 ++--+---+---+---+--+---+---+--++ - + + + + + + + + + - | *A - | *** | - | ** | - 8 ++ *A* ++ - | **** | - | *A* | - | *** | - | ** | - 6 ++ A* ++ - | * | - | * | - | * | - | * | - 4 ++ * ++ - | * | - | * | - | * | - | * | - 2 ++ * ++ - | * | - | * | - | * | - | * | - 0 ++ * ++ - | * | - | * | - | * | - | * | - -2 ++* ++ - |* | - |* | - |* | - * + + + + + + + + - -4 A+--+---+---+---+--+---+---+--++ - 05:065:065:075:075:08:085:095:095:10 + 10 ++---------+-----------+----------+-----------+----------+----------+-----------+---------++ + + + + + + + + + + + | ***A + | ******** | + | ******** | + 8 ++ *****A*** ++ + | *********** | + | ***A***** | + | ******** | + | ******** | + 6 ++ A*** ++ + | * | + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + -2 ++ * ++ + | * | + | * | + | * | + +* + + + + + + + + + -4 A+---------+-----------+----------+-----------+----------+----------+-----------+---------++ + 05:06 05:06 05:07 05:07 05:08 05:08 05:09 05:09 05:10 - 10 ++----+-----+------+-----+----*A - + + + + + *** + - | *A* | - | ** | - | ** | - 8 ++ *A ++ - | **** | - | *A* | - | ** | - | ** | - 6 ++ A ++ - | * | - | * | - | * | - | * | - 4 ++ * ++ - | * | - | * | - | * | - | * | - 2 ++ * ++ - | * | - | * | - | * | - | * | - 0 ++* ++ - | * | - | * | - | * | - |* | - -2 +* ++ - |* | - |* | - * | - * + + + + + - -4 A+----+-----+------+-----+----++ - 05:06 05:07 05:08 05:09 05:10 05:11 + 10 ++----------------+-----------------+------------------+-----------------+-------------****A + + + + + + ********* + + | ***A**** | + | ****** | + | ****** | + 8 ++ ****A** ++ + | ********** | + | ***A**** | + | ****** | + | ****** | + 6 ++ A** ++ + | * | + | * | + | * | + | * | + 4 ++ * ++ + | * | + | * | + | * | + | * | + 2 ++ * ++ + | * | + | * | + | * | + | * | + 0 ++ * ++ + | * | + | * | + | * | + | * | + -2 ++ * ++ + | * | + | * | + |* | + +* + + + + + + -4 A+----------------+-----------------+------------------+-----------------+----------------++ + 05:06 05:07 05:08 05:09 05:10 05:11 EOF @@ -2142,7 +2142,7 @@ sub tryplot my @options = ('--exit', '--extracmds', 'unset grid', - '--terminal', 'dumb 40,40'); + '--terminal', 'dumb 100,40'); unshift @options, @{$args{options}}; my $feedgnuplot = dirname($0) . "/../bin/feedgnuplot"; From d55e54c095da9aaeb111dc235561801b67e773d5 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sun, 20 Oct 2013 00:14:22 -0700 Subject: [PATCH 20/23] version bump --- Changes | 14 ++++++++++++++ bin/feedgnuplot | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index eba3ab1..491dfd7 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,17 @@ +feedgnuplot (1.25) unstable; urgency=low + + * Added test suite + * Added initial support for --timefmt. Currently time/date data is + supported only at the x-axis domain + * Added --exit option for force feedgnuplot to return even if gnuplot + may not yet be done rendering (patch by Eric Schulte) + * Reformatted the documentation + * y2-axis curves no longer have a thicker line by default + * --hardcopy now handles piped output (gnuplot 'set output |process' + syntax) + + -- Dima Kogan Sun, 20 Oct 2013 00:09:36 -0700 + feedgnuplot (1.24) unstable; urgency=low * Fixed regression in --monotonic. This works again now diff --git a/bin/feedgnuplot b/bin/feedgnuplot index 975d9e6..3616f5c 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -13,7 +13,7 @@ use Thread::Queue; use Pod::Usage; use Time::Piece; -my $VERSION = 1.24; +my $VERSION = 1.25; my %options; interpretCommandline(); From f342a42cf92080b8135d0693e9bedbe119e6f1fc Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sun, 20 Oct 2013 00:17:32 -0700 Subject: [PATCH 21/23] updated CPAN depenencies --- Makefile.PL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.PL b/Makefile.PL index 3b28356..584be4d 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -63,7 +63,7 @@ WriteMakefile : ()), PL_FILES => {}, EXE_FILES => [ 'bin/feedgnuplot' ], - PREREQ_PM => { 'Test::Script::Run' => 0}, + BUILD_REQUIRES => { 'String::ShellQuote' => 0}, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'feedgnuplot-*' }, ); From 46123fc3087e177351e9c1a8b4b8738362f567e3 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sun, 20 Oct 2013 00:23:03 -0700 Subject: [PATCH 22/23] main test script gives up if gnuplot isn't available --- t/plots.t | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/plots.t b/t/plots.t index f1aa591..98e7d5e 100644 --- a/t/plots.t +++ b/t/plots.t @@ -13,6 +13,12 @@ BEGIN { print("1..0 # Skip: Perl not compiled with 'useithreads'\n"); exit(0); } + + unless( open( my $pipe, '|-', 'gnuplot' )) + { + print("1..0 # Skip: gnuplot not installed. This is required for feedgnuplot to be useful\n"); + exit(0); + } } use Test::More tests => 52; From 0270ec7679d76879c643d3cc7d200b7d0e3487fc Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sun, 20 Oct 2013 00:39:38 -0700 Subject: [PATCH 23/23] updated reference plots to work specifically with gnuplot 4.6.4 --- t/plots.t | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/t/plots.t b/t/plots.t index 98e7d5e..b351999 100644 --- a/t/plots.t +++ b/t/plots.t @@ -2,8 +2,9 @@ # This tests various features of feedgnuplot. Note that the tests look at actual # plot output using the 'dumb' terminal, so any changes in gnuplot itself that -# change the way the output looks will show up as test failures. Hopefully this -# will not be a big deal +# change the way the output looks will show up as test failures. Currently the +# reference plots come from gnuplot 4.6.4, and I make sure this is the version +# we're testing with # require a threaded perl for my tests. This block lifted verbatim from the cpantesters wiki @@ -14,9 +15,18 @@ BEGIN { exit(0); } - unless( open( my $pipe, '|-', 'gnuplot' )) + open(my $pipe, 'gnuplot --version |'); + if( !$pipe ) { - print("1..0 # Skip: gnuplot not installed. This is required for feedgnuplot to be useful\n"); + print("1..0 # Skip: gnuplot not installed. Tests require ver. 4.6.4; feedgnuplot works with any.\n"); + exit(0); + } + + my $gnuplotVersion = <$pipe>; + chomp $gnuplotVersion; + if ($gnuplotVersion ne "gnuplot 4.6 patchlevel 4") + { + print("1..0 # Skip: tests require gnuplot 4.6.4. Instead I detected '$gnuplotVersion'.\n"); exit(0); } } @@ -318,8 +328,8 @@ tryplot( testname => 'lines on both axes with labels, legends, titles', Test plot y2 10 ++---------+----------+---------+----------+----------+----------+---------+---------*A 30 - + + + + + + + + ** + - | data 0 **A*** | + + + + + + + + data 0 **A*** + + | *** | | *** | 9 ++ ** | | *** #B 25 @@ -368,8 +378,8 @@ tryplot( testname => 'lines on both axes with labels, legends, titles; different Test plot y2 10 ++---------+----------+---------+----------+----------+----------+---------+---------** 30 - + + + + + + + + ** + - | data 0 ****** | + + + + + + + + data 0 ****** + + | *** | | *** | 9 ++ ** | | *** +G 25 @@ -460,12 +470,12 @@ tryplot( testname => 'dataid plot', 25 ++---------+-----------+----------+-----------+----------+----------+-----------+---------+E - + + + + + + + + + - | 2 **A*** | + + + + + + + + + 2 **A*** + | 4 ##B### | | 6 $$C$$$ | | 8 %%D%%% | | 10 @@E@@@ | + | | 20 ++ ++ | | | | @@ -695,7 +705,7 @@ tryplot( testname => 'Circles', refplot => <<'EOF' ); - 5 ++-------+--------+--------+--------+--------+--------+--------+--------*--------+-------** + 5 ++-------+--------+--------+--------+--------+--------+--------+--------******************* + + + + + + + + * + *+ | * * *| | ******** * *| @@ -742,14 +752,14 @@ tryplot( testname => 'Error bars (using extraValuesPerPoint)', refplot => <<'EOF' ); - 5.5 ++---------+-----------+----------+----------+----------+-----------+----------+---------*** + 5.5 ++---------+-----------+----------+----------+----------+-----------+----------+---------** + + + + + + + + * | * 5 ++ +A | * | * | * - 4.5 ++ *** + 4.5 ++ ** | *** | | * | 4 ++ A ++ @@ -773,8 +783,8 @@ tryplot( testname => 'Error bars (using extraValuesPerPoint)', 1.5 ++ ++ | | | | - 1*A* ++ - *** | + 1 A* ++ + ** | | | + + + + + + + + + 0.5 ++---------+-----------+----------+----------+----------+-----------+----------+---------++ @@ -1775,7 +1785,7 @@ tryplot( testname => '--timefmt streaming plot with --monotonic', | *** | + ** + + + + + -4 A*----------------+------------------+-----------------+------------------+----------------++ - 05:06 05:06 05:06 05:06 05:06 05:07 + 05:06 05:06 05:06 05:06 05:06 05:06 @@ -1975,7 +1985,7 @@ tryplot( testname => '--timefmt streaming plot with --monotonic', | *** | + ** + + + + + -4 A*----------------+------------------+-----------------+------------------+----------------++ - 05:06 05:06 05:06 05:06 05:06 05:07 + 05:06 05:06 05:06 05:06 05:06 05:06