Search code examples
streaminglivegnuplot

How to dynamically display text in Gnuplot?


Anyone knows how to dynamically display text in gnuplot?

I am live streaming a data/log file, and I can extract the data from the file, with cat, sed, cut, etc. command, and then gnuplot it. It works great.

But I want to show these numbers, so that that these numbers will dynamically display in the plot at certain position.

I tried to use

set label "< cat file | grep "Time" | cut -d ' ' -f2 | tr -d ','"

But this apparently doesn;t work.

Anyone knows how to set the label as a user defined variable?


Solution

  • You could create a gnuplot command with the customized text / coordinates outside gnuplot, using cat, set, awk and friends, and save it as a separate text file (myText.txt). In your gnuplot script, you could than

    load( "myText.txt" )
    

    this dynamically created command file. See a somewhat similar situation here.