From 2db7f980b51542fb39bd7fb83455a2d6907a18e8 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Mon, 19 Feb 2024 20:43:33 -0800 Subject: [PATCH 1/6] Nicer sample plots in the docs --- bin/feedgnuplot | 138 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 97 insertions(+), 41 deletions(-) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index 90f0d98..0876759 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -1420,56 +1420,112 @@ Simple plotting of piped data: 10 25 $ seq 5 | awk '{print 2*$1, $1*$1}' | - feedgnuplot --lines --points --legend 0 "data 0" --title "Test plot" --y2 1 - --unset grid --terminal 'dumb 80,40' --exit + feedgnuplot \ + --lines \ + --points \ + --title "Test plot" \ + --y2 1 \ + --unset key \ + --unset grid \ + --terminal 'dumb 80,40' \ + --exit Test plot - 10 +-----------------------------------------------------------------+ 25 - | + + + + + + + *##| - | data 0 ***A*#* | - | ** # | - 9 |-+ ** ## | - | ** # | - | ** # | - | ** ## +-| 20 - 8 |-+ A # | - | ** # | - | ** ## | - | ** # | - | ** B | - 7 |-+ ** ## | - | ** ## +-| 15 - | ** # | - | ** ## | - 6 |-+ *A ## | - | ** ## | - | ** # | - | ** ## +-| 10 - 5 |-+ ** ## | - | ** #B | - | ** ## | - | ** ## | - 4 |-+ A ### | - | ** ## | - | ** ## +-| 5 - | ** ## | - | ** ##B# | - 3 |-+ ** #### | - | **#### | - | #### | + | + + + + + + + ##*| + | ##* | + | ## * | + 9 |-+ ## ** | + | ## * | + | ## * | + | ## ** +-| 20 + 8 |-+ B * | + | ## * | + | ## ** | + | ## * | + | ## A | + 7 |-+ ## ** | + | ## ** +-| 15 + | ## * | + | ## ** | + 6 |-+ #B ** | + | ## ** | + | ## * | + | ## ** +-| 10 + 5 |-+ ## ** | + | ## *A | + | ## ** | + | ## ** | + 4 |-+ B *** | + | ## ** | + | ## ** +-| 5 + | ## ** | + | ## **A* | + 3 |-+ ## **** | + | ##**** | + | ##** | |## + + + + + + + | 2 +-----------------------------------------------------------------+ 0 1 1.5 2 2.5 3 3.5 4 4.5 5 -Here we asked for ASCII plotting, which is useful for documentation. - Simple real-time plotting example: plot how much data is received on the wlan0 -network interface in bytes/second (uses bash, awk and Linux): +network interface in bytes/second. This plot updates at 1Hz, and shows the last +10sec of history. The plot shown here is the final state of a sample run - $ while true; do sleep 1; cat /proc/net/dev; done | - gawk '/wlan0/ {if(b) {print $2-b; fflush()} b=$2}' | - feedgnuplot --lines --stream --xlen 10 --ylabel 'Bytes/sec' --xlabel seconds + $ while true; do + sleep 1; + cat /proc/net/dev; + done \ + | gawk '/wlan0/ {if(b) {print $2-b; N++; fflush()} b=$2} N==15 {exit}' \ + | feedgnuplot \ + --lines \ + --title "wlan0 throughput" \ + --stream \ + --xlen 10 \ + --ylabel 'Bytes/sec' \ + --xlabel seconds \ + --unset key \ + --unset grid \ + --terminal 'dumb 80,40' \ + --exit + + wlan0 throughput + 300000 +---------------------------------------------------------------+ + | + + + + + | + | | + | | + | * | + 250000 |-+ * +-| + | ** | + | * * | + | * * | + | * * | + | * * | + 200000 |-+ * * +-| + | * * | + | * * | + | * * | + | * * | + 150000 |-+ * *+-| + | * * | + | * * | + | * * | + | * * | + | * * | + 100000 |-+ * *-| + | * * | + | * *| + | ** * *| + | *** * * *| + 50000 |-+ *** * **** * +*| + | ** ** ***** ** * | + | ** * *** ** * | + | ***** * ***** ** | + |** *** | + | + + + + + | + 0 +---------------------------------------------------------------+ + 6 8 10 12 14 + seconds =head1 DESCRIPTION From 2d8344f32d483f4e2afe0f8e01bee98c3cf2b15d Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Mon, 19 Feb 2024 20:55:29 -0800 Subject: [PATCH 2/6] README.pod contains graphical images for the website --- README.pod | 76 +++---- ...ntation-header-network-throughput-plot.svg | 141 ++++++++++++ documentation-header-plot.svg | 204 ++++++++++++++++++ extract_README.sh | 25 ++- 4 files changed, 399 insertions(+), 47 deletions(-) create mode 100644 documentation-header-network-throughput-plot.svg create mode 100644 documentation-header-plot.svg diff --git a/README.pod b/README.pod index 951a099..f5c45f4 100644 --- a/README.pod +++ b/README.pod @@ -21,56 +21,40 @@ Simple plotting of piped data: 10 25 $ seq 5 | awk '{print 2*$1, $1*$1}' | - feedgnuplot --lines --points --legend 0 "data 0" --title "Test plot" --y2 1 - --unset grid --terminal 'dumb 80,40' --exit + feedgnuplot \ + --lines \ + --points \ + --title "Test plot" \ + --y2 1 \ + --unset key \ + --unset grid \ + --terminal 'dumb 80,40' \ + --exit - Test plot - - 10 +-----------------------------------------------------------------+ 25 - | + + + + + + + *##| - | data 0 ***A*#* | - | ** # | - 9 |-+ ** ## | - | ** # | - | ** # | - | ** ## +-| 20 - 8 |-+ A # | - | ** # | - | ** ## | - | ** # | - | ** B | - 7 |-+ ** ## | - | ** ## +-| 15 - | ** # | - | ** ## | - 6 |-+ *A ## | - | ** ## | - | ** # | - | ** ## +-| 10 - 5 |-+ ** ## | - | ** #B | - | ** ## | - | ** ## | - 4 |-+ A ### | - | ** ## | - | ** ## +-| 5 - | ** ## | - | ** ##B# | - 3 |-+ ** #### | - | **#### | - | #### | - |## + + + + + + + | - 2 +-----------------------------------------------------------------+ 0 - 1 1.5 2 2.5 3 3.5 4 4.5 5 - -Here we asked for ASCII plotting, which is useful for documentation. +=for html

Simple real-time plotting example: plot how much data is received on the wlan0 -network interface in bytes/second (uses bash, awk and Linux): +network interface in bytes/second. This plot updates at 1Hz, and shows the last +10sec of history. The plot shown here is the final state of a sample run - $ while true; do sleep 1; cat /proc/net/dev; done | - gawk '/wlan0/ {if(b) {print $2-b; fflush()} b=$2}' | - feedgnuplot --lines --stream --xlen 10 --ylabel 'Bytes/sec' --xlabel seconds + $ while true; do + sleep 1; + cat /proc/net/dev; + done \ + | gawk '/wlan0/ {if(b) {print $2-b; N++; fflush()} b=$2} N==15 {exit}' \ + | feedgnuplot \ + --lines \ + --title "wlan0 throughput" \ + --stream \ + --xlen 10 \ + --ylabel 'Bytes/sec' \ + --xlabel seconds \ + --unset key \ + --unset grid \ + --terminal 'dumb 80,40' \ + --exit + +=for html

=head1 DESCRIPTION diff --git a/documentation-header-network-throughput-plot.svg b/documentation-header-network-throughput-plot.svg new file mode 100644 index 0000000..e9f5bde --- /dev/null +++ b/documentation-header-network-throughput-plot.svg @@ -0,0 +1,141 @@ + + + +Gnuplot +Produced by GNUPLOT 6.1 patchlevel 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + 50000 + + + + + 100000 + + + + + 150000 + + + + + 200000 + + + + + 250000 + + + + + 300000 + + + + + 6 + + + + + 8 + + + + + 10 + + + + + 12 + + + + + 14 + + + + + + + + + gnuplot_plot_1 + + + + + + + + + + + + Bytes/sec + + + + + seconds + + + + + + + wlan0 throughput + + + + + + + diff --git a/documentation-header-plot.svg b/documentation-header-plot.svg new file mode 100644 index 0000000..169795a --- /dev/null +++ b/documentation-header-plot.svg @@ -0,0 +1,204 @@ + + + +Gnuplot +Produced by GNUPLOT 6.1 patchlevel 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + + + + 8 + + + + + 9 + + + + + 10 + + + + + 1 + + + + + 1.5 + + + + + 2 + + + + + 2.5 + + + + + 3 + + + + + 3.5 + + + + + 4 + + + + + 4.5 + + + + + 5 + + + + + 0 + + + + + 5 + + + + + 10 + + + + + 15 + + + + + 20 + + + + + 25 + + + + + + + + + gnuplot_plot_1 + + + + + + + + + gnuplot_plot_2 + + + + + + + + + + + + + + + + + + + Test plot + + + + + + + diff --git a/extract_README.sh b/extract_README.sh index 2d9b2cf..641b8df 100755 --- a/extract_README.sh +++ b/extract_README.sh @@ -10,5 +10,28 @@ L<"slides"|https://github.com/dkogan/talk-feedgnuplot-vnlog/blob/master/feedgnup EOF +seq 5 | awk '{print 2*$1, $1*$1}' | + feedgnuplot \ + --lines \ + --points \ + --title "Test plot" \ + --y2 1 \ + --unset key \ + --unset grid \ + --hardcopy 'documentation-header-plot.svg' + + +< bin/feedgnuplot \ + awk '/^ *Test plot$/,/^ *1 +1.5 +2 +2.5/ \ + { if(!wrote_plot1) { print "=for html

"; \ + wrote_plot1 = 1; } \ + next; \ + } \ + /^ *wlan0 throughput$/,/seconds/ \ + { if(!wrote_plot2) { print "=for html

"; \ + wrote_plot2 = 1; } \ + next; \ + } \ + /=head1/,0 \ + { print }' >> README.pod -< bin/feedgnuplot awk '/=head1/,0' >> README.pod From 6340dd3582f8a5c476acc1711e02dfed98a5d628 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Mon, 19 Feb 2024 21:25:27 -0800 Subject: [PATCH 3/6] documentation --- README.pod | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/README.pod b/README.pod index f5c45f4..2e88eda 100644 --- a/README.pod +++ b/README.pod @@ -517,9 +517,16 @@ Interpret the X data as a time/date, parsed with the given format C<--colormap> -Show a colormapped xy plot. Requires extra data for the color. zmin/zmax can be -used to set the extents of the colors. Automatically sets the -C<--rangesize>/C<--tuplesize>. +This is a legacy option used to who a colormapped xy plot. It does: + +- Adds C to C<--curvestyleall> + +- Adds 1 to the default C<--tuplesize> (if C<--tuplesizeall> is not given + +- Uses C<--zmin>, C<--zmax> to set the colorbar range + +It's clearer to set the relevant options explicitly, but C<--colormap> still +exists for compatibility =item @@ -596,10 +603,11 @@ instance C<--set 'xrange [20:10]'> to set the given inverted bounds. =item -C<--xlabel/x2label/ylabel/y2label/zlabel xxx> +C<--xlabel/x2label/ylabel/y2label/zlabel/cblabel xxx> Label the given axis. The x2/y2-axis labels do not apply to 3d plots while the -z-axis label applies I to 3d plots. +z-axis label applies I to 3d plots. The "cblabel" applies to the colorbar, +if there is one. =item From d57634bcf9769b3d6ec879e93198e3604313e344 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Mon, 19 Feb 2024 21:38:00 -0800 Subject: [PATCH 4/6] website documentation doesn't say it's making ascii art because that documentation shows a graphical image --- README.pod | 8 ++------ bin/feedgnuplot | 10 ++++------ extract_README.sh | 2 +- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/README.pod b/README.pod index 2e88eda..e955072 100644 --- a/README.pod +++ b/README.pod @@ -27,9 +27,7 @@ Simple plotting of piped data: --title "Test plot" \ --y2 1 \ --unset key \ - --unset grid \ - --terminal 'dumb 80,40' \ - --exit + --unset grid =for html

@@ -50,9 +48,7 @@ network interface in bytes/second. This plot updates at 1Hz, and shows the last --ylabel 'Bytes/sec' \ --xlabel seconds \ --unset key \ - --unset grid \ - --terminal 'dumb 80,40' \ - --exit + --unset grid =for html

diff --git a/bin/feedgnuplot b/bin/feedgnuplot index 0876759..1b81382 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -1421,14 +1421,13 @@ Simple plotting of piped data: $ seq 5 | awk '{print 2*$1, $1*$1}' | feedgnuplot \ + --terminal 'dumb 80,40' --exit \ --lines \ --points \ --title "Test plot" \ --y2 1 \ --unset key \ - --unset grid \ - --terminal 'dumb 80,40' \ - --exit + --unset grid Test plot 10 +-----------------------------------------------------------------+ 25 @@ -1478,6 +1477,7 @@ network interface in bytes/second. This plot updates at 1Hz, and shows the last done \ | gawk '/wlan0/ {if(b) {print $2-b; N++; fflush()} b=$2} N==15 {exit}' \ | feedgnuplot \ + --terminal 'dumb 80,40' --exit \ --lines \ --title "wlan0 throughput" \ --stream \ @@ -1485,9 +1485,7 @@ network interface in bytes/second. This plot updates at 1Hz, and shows the last --ylabel 'Bytes/sec' \ --xlabel seconds \ --unset key \ - --unset grid \ - --terminal 'dumb 80,40' \ - --exit + --unset grid wlan0 throughput 300000 +---------------------------------------------------------------+ diff --git a/extract_README.sh b/extract_README.sh index 641b8df..cfa9f36 100755 --- a/extract_README.sh +++ b/extract_README.sh @@ -33,5 +33,5 @@ seq 5 | awk '{print 2*$1, $1*$1}' | next; \ } \ /=head1/,0 \ - { print }' >> README.pod + { if(!/^ *--terminal .dumb 80,40. --exit/) { print } }' >> README.pod From 5837b13c00700293f8077b60a7af0a10e22a5b00 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Fri, 19 Dec 2025 11:21:55 -0800 Subject: [PATCH 5/6] bug fix: --image doesn't touch xrange,yrange if those are given in --set This was already implemented, but due to a bug (perl precedence was surprising) didn't work right --- bin/feedgnuplot | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/feedgnuplot b/bin/feedgnuplot index 1b81382..70ba7c1 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -502,8 +502,7 @@ sub interpretCommandline # bottom-left, so given nothing else, I flip the y axis if( !defined $options{xmin} && !defined $options{xmax} && !defined $options{ymin} && !defined $options{ymax} && - ! any { /^ *xrange\b/ } @{$options{set}} && - ! any { /^ *yrange\b/ } @{$options{set}} ) + !any { /^ *[xy]range\b/ } @{$options{set}} ) { push @{$options{set}}, "xrange [:] noextend"; push @{$options{set}}, "yrange [:] reverse noextend"; From 840077e67760109f715960dbfd00c0564a71928b Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 20 Dec 2025 12:11:30 -0800 Subject: [PATCH 6/6] new release --- Changes | 6 ++++++ bin/feedgnuplot | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 0d5b5d3..883b4af 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,9 @@ +feedgnuplot (1.63) + + * bug fix: --image doesn't touch xrange,yrange if those are given in --set + + -- Dima Kogan Sat, 20 Dec 2025 12:11:05 -0800 + feedgnuplot (1.62) * I explicitly ignore all lines that have '-' values diff --git a/bin/feedgnuplot b/bin/feedgnuplot index 70ba7c1..3509ccf 100755 --- a/bin/feedgnuplot +++ b/bin/feedgnuplot @@ -16,7 +16,7 @@ use Pod::Usage; use Time::Piece; # Makefile.PL assumes this is in '' -my $VERSION = '1.62'; +my $VERSION = '1.63'; my %options; interpretCommandline();