dkogan / feedgnuplot Goto Github PK
View Code? Open in Web Editor NEWTool to plot realtime and stored data from the commandline, using gnuplot.
License: Other
Tool to plot realtime and stored data from the commandline, using gnuplot.
License: Other
could you replace it with a permalink?
http://search.cpan.org/perldoc?feedgnuplot
or use a permalink for metacpan instead
If I run feedgnuplot in one of my tmux windows like this:
> feedgnuplot --terminal dumb --exit
I can enter some numbers, and then press Ctrl+d and it will print a graph.
But if instead I trying sending output to its STDIN file descriptor from another shell, e.g:
echo "1\n2\n3\n" > /proc/$(pgrep feedgnuplot)/fd/0
and then pressing Ctrl+d in the feedgnuplot terminal/tmux window, then I get this error:
gnuplot> plot
^
line 0: function to plot expected
If, before pressing Ctrl+d I type print
and exit
into the feedgnuplot window (directly, not via /proc), like this:
1
2
3
print
enter
then it works, and prints a graph.
But if I try sending those commands along with the data via /proc I get the same error:
echo "1\n2\n3\nprint\nexit" > /proc/$(pgrep feedgnuplot)/fd/0
In the feedgnuplot window:
gnuplot> plot
^
line 0: function to plot expected
What's going on here?
How can I send input to feedgnuplot from a different shell?
I run (on Ubuntu 13.04):
seq 5 | awk '{print 2*$1, $1*$1}' | bin/feedgnuplot --domain
No output, no windows.
using #!/usr/bin/env perl instead of #!/usr/bin/perl ?
gnuplot
has support for changing the data separator (see set datafile separator
, p. 160 of http://www.gnuplot.info/docs_6.0/Gnuplot_6.pdf), but as far as I can tell feedgnuplot
doesn't.
Passing --set 'datafile separator comma'
does no good, because as far as I can tell feedgnuplot
parses the input lines before sending them to gnuplot
.
I have data in CSV files that I'd like to plot, and it looks like my options currently are
gnuplot
directly instead of fronting it with feedgnuplot
At the very least, the documentation should state that values need to be space-delimited. Currently README.md
uses the phrase "Input parsing is flexible", which I think is misleading with respect to the input data format.
I can probably assign a var with --cmds 'var="TEST"'
. But can I use it later? For instance, when setting a title?
(The problem that I actually have in mind is a bit more complex: I have a stream with three columns, the first two are coordinates for axes, and the third one is a constant that I'd like to use as a frequency setting for xtics. Would it be possible?)
The first example in the README produces a syntax error.
Can't open Test plot: No such file or directory at /usr/bin/feedGnuplot line 405.
gnuplot> plot
^
line 0: function to plot expected
If the equals sign is removed it works fine.
index b2c224f..89e4280 100644
--- a/README.pod
+++ b/README.pod
@@ -14,7 +14,7 @@ Simple plotting of stored data:
10 25
$ seq 5 | awk '{print 2*$1, $1*$1}' |
- feedGnuplot --lines --points --legend 0="data 0" --title "Test plot" --y2 1
+ feedGnuplot --lines --points --legend 0 "data 0" --title "Test plot" --y2 1
Simple real-time plotting example: plot how much data is received on the wlan0
network interface in bytes/second (uses bash, awk and Linux):
Hello Dima,
I have started to use the feedgnuplot. What is the option to passed the commands from feedgnuplot to gnuplot after:
plot '-'
when I use the option --with "every ::4::300" it does:
plot '-' notitle with every ::4::300
I want to achive:
plot '-' every ::4::300 notitle
Best Regards
Mirek
I'm running one of the examples (plotting how much data is received on the wlan0 network interface), and unfortunately the graph looks like grass, and it's impossible to figure out what the average bandwidth is (for example). When I've had this problem on AWS CloudWatch graphs, the solution has been to increase the period between samples, and the grass turns into a nice smooth line. In this example, changing the 'sleep 1' to 'sleep 60' or something higher will do that, but this only works because the /proc/net/dev data is a running total.
$ 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
I've seen a Gnuplot demo for getting a running average, can we use that with feedgnuplot somehow?
Thanks!
Greetings
I'm testing out Feedgnuplot and I'm having some issues.
I can execute a program ./rtauto-usb2001tc that gets real time temperature from a thermocouple and displays it on the screen. The data in the columns represent the timestamp, temperature in Celsius, and temperature in Fahrenheit.
See First_animation.gif of what the program ./rtauto-usb2001tc does when executed.
The command I tried to plot real time data is below.
./rtauto-usb2001tc | tee output.csv | awk '{print $1 $3}' | feedgnuplot --stream --with linespoints
Thanks for a great app!!
Hi, is it possible to implement a "pause" data command, that will pause feedgunplot (discard all data after "pause", and don't update the plot) until receive a "resume" data command. Thanks!
Example,
data0
pause
data1
resume
data2
UPDATE: I think the data command is not essential, please close the issue.
Hello
I'm using the feedgnuplot and works fine. But i need some more advanced, i have a file with the settings to a multiplot, so i will to load the file using feedgnuplot, it can be? how to plot a multiplot?
Thanks!
--y4
and so on.
Additional axes should be displayed also at left and at right of the plot, matching in colour of the data points.
My data is
Address Minutes
8.19.245.84 4853.30
8.19.245.83 4797.70
8.19.245.78 4221.10
8.19.245.77 4170.60
8.19.245.62 3382.00
8.19.245.61 3348.30
8.19.245.72 1774.40
8.19.245.71 1750.70
8.19.245.70 1065.00
8.19.245.69 1057.80
8.19.245.88 1000.80
8.19.245.87 955.40
and a need a simple histogram to compare each IP.
I tried with
feedgnuplot --histo 0 --binwidth 0.1 --hardcopy /api/tst.pn
and get the wrong image
Instead, I should get something similar to
but of course showing the labels under each column
what am I doing wrong?
I have feedgnuplot version 1.34 and can't seem to get the exit command to work properly (only tried gnome-terminal with zsh and bash).
Here is the command I run:
feedgnuplot --lines --stream 0 --exit
1
2
3
1
replot
exit
...
<CTRL-D>
What I expect:
What happens:
CTRL-D works when I use it on an instance of feedgnuplot which doesn't have the --stream flag set (still requires --exit).
exit never works.
Let me know if I need to give out more details.
Best,
Hi,
I posted a comment on closed Issue #7 regarding logarithmic histograms. Not sure if github will send notifications regarding a comment on a closed issue, so I am just posting a new open issue here to make sure it is seen.
Thanks,
Daniel
Example: plotting the the input of soundcard:
arecord | hexdump -ve '1/1 "%d\n"' | feedGnuplot.pl --xlen 24000 # some data read, some plot is drawn, but then: gnuplot> 55580 ^ line 126069: invalid command gnuplot> -1 ^ line 126069: invalid command gnuplot> 55581 ^ line 126069: invalid command
What specific package could my distro be missing if I get the following message when trying to execute feedgnuplot?
Can't locate List/MoreUtils.pm in @inc (@inc contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/bin/feedgnuplot line 12
Thanks
cat /tmp/data | feedgnuplot --terminal 'dumb 100,20' --unset xtics --dump
set terminal dumb 100,20
set grid
unset xtics
set boxwidth 1
histbin(x) = 1 * floor(0.5 + x/1)
set xtics <-- it is set again!!!
plot '-' notitle
1 176
2 135
3 67
4 125
5 82
6 86
7 41
8 145
9 69
10 67
11 40
e
I'd like to be able to plot data separated by tabs, with data id having space in their names.
I use command feedgnuplot --domain --dataid --autolegend --lines --points --exit --dump < sample.txt
With data like :
4<tab>"A"<tab>34
4<tab>"B"<tab>8
5<tab>"A"<tab>15
5<tab>"B"<tab>13
6<tab>"A"<tab>23
6<tab>"B"<tab>16
I got :
set style data linespoints
set grid
set boxwidth 1
histbin(x) = 1 * floor(0.5 + x/1)
set xtics
plot '-' title "A" , '-' title "B"
4 34
5 15
6 23
e
4 8
5 13
6 16
e
as expected.
With data like :
4<tab>"A space"<tab>34
4<tab>"B space"<tab>8
5<tab>"A space"<tab>15
5<tab>"B space"<tab>13
6<tab>"A space"<tab>23
6<tab>"B space"<tab>16
I got
set style data linespoints
set grid
set boxwidth 1
histbin(x) = 1 * floor(0.5 + x/1)
set xtics
plot '-' title ""A" , '-' title ""B"
4 space"
5 space"
6 space"
e
4 space"
5 space"
6 space"
e
not what I expect.
I've not been able to run any example. Maybe due to some differencies in BSD and GNU command line tools?
Running this example just never ends:
➜ ~ seq 5 | awk '{print 2_$1, $1_$1}' | feedgnuplot
...
I've checked and it is not a seq or awk problem:
➜ ~ seq 5 | awk '{print 2_$1, $1_$1}'
2 1
4 4
6 9
8 16
10 25
I can debug if you give me orientation.
Hi,
can you please change the shebang from
#!/usr/bin/perl5.30
to
#!/usr/bin/env perl
and if required add something like
use 5.030;
I do not know how to make a pull request.
greetings, el
Hi Dima,
How the option feedgnuplot --stream influences gnuplot. Does the gnuplot uses
while (1) { pause ; replot; }
Best Regards
Mirek
1.45 is OK
iMac-TMP:~ joe$ echo -n "seq 5" | /usr/local/Cellar/feedgnuplot/1.45/bin/feedgnuplot --terminal 'dumb 80,20' --exit
5 +---------------------------------------------------------------------+
| + + + + |
4.5 |-+...........:.............:.............:.............:...........+-|
| : : : : |
4 |-+...........:.............:.............:.............:...........+-|
| : : : : |
3.5 |-+...........:.............:.............:.............:...........+-|
| : : : : |
3 |-+...........:.............:.............:.............:...........+-|
| : : : : |
2.5 |-+...........:.............:.............:.............:...........+-|
| : : : : |
2 |-+...........:.............:.............:.............:...........+-|
| : : : : |
1.5 |-+...........:.............:.............:.............:...........+-|
| + + + + |
1 +---------------------------------------------------------------------+
0 0.2 0.4 0.6 0.8 1
1.46 is not.
iMac-TMP:~ joe$ echo -n "seq 5" | /usr/local/Cellar/feedgnuplot/1.46/bin/feedgnuplot --terminal 'dumb 80,20' --exit
Global symbol "$icurve" requires explicit package name at /usr/local/Cellar/feedgnuplot/1.46/bin/feedgnuplot line 931.
Execution of /usr/local/Cellar/feedgnuplot/1.46/bin/feedgnuplot aborted due to compilation errors.
iMac-TMP:~ joe$
The following time format is not usable with feedgnuplot, but it is fully compatible with gnuplot:
--timefmt '%H:%M:%3.S'
for time like this: 16:02:54.672
The perl script terminates because Time::Piece
does not support millisecond in the time formats:
http://stackoverflow.com/questions/4012068/how-do-i-parse-microseconds-with-timepiece-strptime
1- Is it possible to also show y-values on the graph itself similar to this?
2- Is it possible to only print the last data point somewhere on the graph?
Thanks for your awesome tool.
Gnuplot has builtin support for the DomTerm terminal emulator, which can display HTML and SVG inline. At least my simple test worked really well, just replacing the --terminal
option with domterm
:
The simplest way to try out DomTerm is using DomTerm-X.Y.Z.AppImage
Hi,
I'm plotting the ping rtt with a command similar to this:
sudo ping -A 172.15.0.3 -D | gawk '$4=="from" && $8~/time=/ && $9=="ms" {gsub(/[\[#\]]/, "", $1); gsub("time=", "", $8); print $1, $8; fflush()}' | feedgnuplot --domain --stream --lines --histogram 0 --binwidth 0.001 --histstyle freq--style 0 "linewidth 2"
This works as expected, but it clogs down at some point because it's keeping all old data.
If I add "--xlen 10", gnuplot complains:
gnuplot> plot '-' using (histbin($2)):(1.0) smooth freq notitle linewidth 2
^
line 30480: all points y value undefined!
Am I misunderstanding the functionality? Is this a bug?
Thanks,
Vladimir
Dear Developers and Users,
I have used feedGnulpot for a few days and I was wondering if there is a possibility to set logarithmic scale.
If this is possible to do, please advice.
Cheers,
Eelis
Just letting you know :)
Using feedgnuplot --stream --terminal 'dumb 120,30' --lines
causes continuous new plots to be outputted, not updating a single plot:
I tried --terminal 'domterm'
which hanged, and --terminal 'xterm'
:
Warning: empty y range [1.8:1.8], adjusting to [1.782:1.818]
!r#W!r>U!r#W!r$B!r>U!r>J!g!C 1.78
$j#W$j>U$j#W$j$B$j>U$j>J#� U 1.785
'b#W'b>U'b#W'b$B'b>U'b>J&w!C 1.79
)z#W)z>U)z#W)z$B)z>U)z>J)o U 1.795
,r#W,r>U,r#W,r$B,r>U,r>J,g!Q 1.8
/j#W/j>U/j#W/j$B/j>U/j>J.� U 1.805
2b#W2b>U2b#W2b$B2b>U2b>J1w!C 1.81
4z#W4z>U4z#W4z$B4z>U4z>J4o U 1.815
7r#W7r>U7r#W7r$B7r>U7r>J7g!C 1.82
...
Generating multiple plots with stringed together bash commands (i.e.) [plot 1 generator] & [plot 2 generator] & [plot 3 generator]
generates a separate process for each, thus hiding all but the last plot from being able to ctrl+c exited. Even if the data stream runs out or is turned off, and each plot window is closed, these processes remain behind, and the plot windows will reappear after the data stream starts again. The only method for truly closing these processes that I've found is to find the PID and kill it through the terminal.
Using the --stream
and --exit
parameters, I'd expect these background processes, including the feedgnuplot, gnuplot, and window process for each to die.
feedgunplot v1.48
OS: Ubuntu 18.04.03
Windows Manager: Regolith based on i3wm
A minimal example of the code I am using to generate the plots is as follows:
{
adb logcat -c
while true; do
sleep 1;
adb logcat -v raw $logcatTag *:S;
done
} | feedgnuplot --lines --stream $updateTime --exit &
{
adb logcat -c
while true; do
sleep 1;
adb logcat -v raw $logcatTag2 *:S;
done
} | feedgnuplot --lines --stream $updateTime --exit
All the bash variables are standard strings that I set through a CLI.
Is there any standard way of generating multiple plot windows without having to search for their PID and manually kill them every time I use feedgunplot? Would you recommend some other approach? Is there an easy way to access the subplot functionality from gnuplot via a feedgnuplot feedthrough type command? I saw a hanging open issue here. Is there any progress on that? You mentioned some things being possible, but not exactly what the issue creator had in mind. Is there any documentation or examples of doing what is currently possible?
The original implementation from Thanassis Tsiodras contained a way to pass the -geometry option to gnuplot, in order to set the plotting window size and position.
Could you add this feature in your Perl script too?
The format is standard : when you call gnuplot, simply add -geometry to the parameter list:
$geometry='320x240+0+0'
open PIPE, "|gnuplot $dopersist -geometry $geometry" or die "Can't initialize gnuplot\n";
Thank you and congratulation for this project
Maxime
This is often done in papers and I'd like to do the same. Is it possible with feedgnuplot or do I have to go for manual gnuplot scripts? Reading the man page makes me think it cannot be done currently. I could think of a hack to pass the dataset twice, but the histstyle argument does not allow choosing a specific curve to render AFAIK. Thanks.
Unmatched ) in regex; marked by <-- HERE in m/ <> ) <-- HERE
{
next if / at ./feedGnuplot.pl line 317.
perl -v
This is perl, v5.8.8 built for x86_64-linux-thread-multi
The machine is a RHEL5
Hi,
I'm trying to plot two domains, where x is time. If I try to specify the time format, I run in problem like this:
http://stackoverflow.com/questions/1767758/treat-axis-as-date-time-epoch
the problem is not posted by me, but it is a similar problem. How this could be avoided?
Cheers,
Eelis
This plots two curves 0 and 1:
seq 100 | awk '{print 2_$1, $1%2, ($1%2+1)_$1}'| feedGnuplot --domain --dataid --autolegend
But when I try to add
--curvestyleall 'with dots'
I only get the first curve shown.
Also, can you provide an example of --curvestyle,
what I want to do is set the pointsize to 4 of curve '1' and maybe make the symbol an x
I can't figure out how to address curve 1 and in what gnuplot syntax it takes style commands.
Hi !
Just found feedgnuplot via your federated post on planet.debian.org. Very cool tool !
I just noticed some displaying issues in pure wayland:
using X:
karl@karl-acer2:~$ while true; do < /sys/class/thermal/thermal_zone0/temp awk '{ print $0/1000 }';sleep 1;done | feedgnuplot --stream --with linespoints --exit Warning: empty y range [51:51], adjusting to [50.49:51.51] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
karl@karl-acer2:~$ while true; do < /sys/class/thermal/thermal_zone0/temp awk '{ print $0/1000 }';sleep 1;done | QT_QPA_PLATFORM=wayland feedgnuplot --stream --with linespoints --exit Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. QSocketNotifier: Can only be used with threads started with QThread Using Wayland-EGL Using the 'xdg-shell-v6' shell integration
As you can see the axis labels get messed up, anything you can do about this ?
Cheers,
Karl
Is it OK?
# cpan feedgnuplot
Going to read '/root/.cpan/Metadata'
Database was generated on Thu, 26 Feb 2015 02:17:01 GMT
Warning: Cannot install feedgnuplot, don't know what it is.
Try the command
i /feedgnuplot/
to find objects with matching identifiers.
I have data that looks like this:
2019-12-09 16:57:05;138712
2019-12-10 19:13:44;138712
2019-12-12 15:53:57;138957
2019-12-12 16:22:58;139375
2019-12-13 14:32:26;139474
2019-12-16 16:54:11;139474
2019-12-17 16:06:39;139179
2019-12-18 17:13:14;139316
2019-12-19 16:42:33;139353
2019-12-20 16:21:48;139353
It would be useful to do feedgnuplot --separator ";"
to easily be able to do --timefmt '%Y-%m-%d %H:%m:%s'
. Is there workaround?
This is a feature request.
I'd love to see support for plotting histograms with feedgnuplot. I often want to see a distribution of command-line data. Would it be difficult to add a --hist option which default to breaking the input data into say 100 boxes, and then takes an optional argument to customize the number of boxes.
If I find the time I'll take a look at this, and if my Perl still works I'll submit a patch (but those are both big IFs).
Thanks for providing this fantastic tool!
Hi,
I am in need of a way to run feedgnuplot in a command-line-only environment, and the "dumb" terminal does not look too good. Compiling gnuplot 5.2 with "./configure --with-caca" gives me a feedgnuplot environment where:
I know these probably sound more like caca terminal implementation bugs, but I don't know enough about how gnuplot works in order to be able to debug it. Can you please help identify the source of these issues?
Thanks,
Vladimir
P.S. this is not a joke
The basic example is failing with the following error. I put the output the seq awk command into a file, but other than that it is the same.
$ cat data.txt | ~/sources/feedGnuplot/bin/feedGnuplot --lines --points
Use of uninitialized value in numeric ge (>=) at /Users/seanhess/sources/feedGnuplot/bin/feedGnuplot line 608, <> line 1.
Tried to exceed the --maxcurves setting.
Invoke with a higher --maxcurves limit if you really want to do this.
Plot windows steal focus not allowing me to return to the shell prompt to ctrl+c to exit.
Run a script that pipes a stream of data to feedgunplot, it opens a window, and feeds data to it, while remaining in the background. Then, even if data stream is not finished, I can return to the bash terminal and force it to close/exit.
feedgunplot v1.48
OS: Ubuntu 18.04.03
Windows Manager: Regolith based on i3wm
I'm using feedgnuplot to plot some android logcat data , and it plots everything as expected, but even after reading the --exit section of the man pages, I cannot seem to figure out how to exit the plot window without turning the data source off, or other hacky workarounds.
The reason I cannot use the typical ctrl+c exit command is that feedgnuplot seems to be creating a new window with each loop containing new data (note this is on the order of milliseconds), and my window manager is always shifting focus to this "new" window so I cannot even return to the terminal that initialized the plot window to enter the control+c command. Note this behavior also prevents me from simply force closing the plot window itself, as it will just be regenerated on the next loop. Is my understanding of the plot window generation true here (i.e. it is generating a new window with each update)? Or is it a single window, and something I need to address with my windows manager.
I can hold ctrl+c and mouse click the terminal window frantically until is slips between the millisecond loops, or I can turn off the data source then the feedgnuplot window no longer updates, and the window manager no longer forces focus there, so I can return to the terminal and control+c to close the plot window.
As I often want to open multiple plots based on the data I am seeing, I don't want to shut down my data source each time, so I am hoping for a way to prevent this feedgnuplot window from stealing focus every few milliseconds without:
The code I am using to generate the plot is as follows:
{
adb logcat -c
while true; do
sleep 1;
adb logcat -v raw $logcatTag *:S;
done
} | feedgnuplot --lines --stream $updateTime --exit
All the bash variables are standard strings that I set througha CLI.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.