pipe plot data to gnuplot script

If you are on a Unix system (i.e. not Windows) you can use '<cat' instead of '-' to read from stdin:

plot '<cat' using ...

Then you can do cat data.txt | gnuplot script.gp. However, in the specific case you mention in your question, with the plot in the for loop, you read the input three times. So sending the data through stdin is not appropriate, since the data will be gone after the first time it is read.

Leave a Comment