UNLIMITED

Linux Format

Live-plotting data

One popular choice for logging into Linux machines on Windows is puTTY. Admittedly, it only acts as a dumb terminal, but a command line interface is perfectly good for coding, especially when a fancy GUI would slow down the network connection. One possible drawback would seem to be the inability to generate live plots of machine activity using the beautiful graphics in Gnuplot (see John Lane’s article in LXF244 for an introduction),

A live plot is a graph that’s periodically updated to reflect changes to its input data. That’s well within Gnuplot’s skillset, and can be coded using a while loop and calls to replot and pause . However, this tutorial describes a variation of that approach, where a shell script wakes up Gnuplot accordingly when it’s time to update the plot.

The restriction to a dumb terminal turns out to be no problem for Gnuplot either – it can generate graphs for a wide range of devices, including dumb ones. The resulting graphics are a little primitive, so the script described here also produces PNG files, and an animated GIF. The GIF acts as a simple record of all the changes to the plot during the script’s execution.

See Figure 1 for a summary of the. When it’s time for plotting, the script sends an integer to the script via a pipe. The script is waiting for integer input, then reads in the data file, and generates new text-based and PNG graphs. Then it suspends again, waiting for another integer.

You’re reading a preview, subscribe to read more.

More from Linux Format

Linux Format1 min read
Intel Patch For Outdated Microcode?
Intel engineer Dave Hansen has sparked a “Microcode Revision Discussion” regarding a proposed Linux patch on the kernel mailing list. This new feature would report outdated microcode through the existing sysfs vulnerabilities reporting system. Specif
Linux Format1 min read
Get More Pieces Of Pi
Les Pounder works with groups such as the Raspberry Pi Foundation to help boost people’s maker skills. My desk has seen a plethora of Raspberry Pi products these last two weeks, starting with the new Raspberry Pi-branded microSD cards and a rubber bu
Linux Format13 min read
Fyne Times Ahead
Developing software to run across Linux distros is bad enough, but Andrew Williams, CEO of Fyne Labs (https://fynelabs.com), is making software easier to run across operating systems, devices and the web. We sat down with him and chatted about Go, Ja

Related