linux_cli_live_plot_using_gnuplot

linux cli live plot using gnuplot

thanks to Horation Caine for the essentials…

write data to plot.dat .. for example graph nvidia-smi delivered GPU temperature of a Tesla card:

while true; do echo -e "$(<plot.dat)\n##\t$(nvidia-smi | grep -A1 Tesla | tail -1 | awk '{print $3}' | tr -d C)" | tail -n 60 | awk '{print NR "\t" $2}' > plot.new && mv -f plot.new plot.dat && cat plot.dat; sleep 1; done

gnuplot script to display update a graph on the command line every second, save this to

set yrange [60:85]
set xrange [1:60]
set terminal dumb
plot "plot.dat" using 1:2 with lines
pause 1
reread

run the plot:

 gnuplot liveplot.gnu
  • linux_cli_live_plot_using_gnuplot.txt
  • Last modified: 08.05.2020 19:29
  • by Pascal Suter