2

I'm having some problems trying to plot two different data sets from stdin in gnuplot... This is the command I'm testing with:

% gnuplot -persist <<EOF            
plot '-' index 0 with points, \
'' index 1 with points
1 1.2
2 1.8
3 1.6


1.1 0.8
2.1 0.3
3.1 1.0
EOF

Any advise will be very helpful. Thanks

quicoju
  • 1,661
  • 11
  • 15

2 Answers2

6

I think this should help you

It’s even possible to read data from standard input multiple times within the same plot command:

plot '-', '-' 

will read data until an end-of-file character is encoun tered and then expect to read more data (for the second “file”) until finding a second EOF character. Of course, the data entered at a prompt this way can have multiple col umns, from which we can select some with using, and all the other features of the plot command can be used as well.

(from: Philipp K. Janert, Gnuplot In Action)

vaettchen
  • 7,299
  • 22
  • 41
1

Gnuplot probably wants to reread the input for the second index keyword, but stdin is not seekable. Create a temporary input file.

choroba
  • 231,213
  • 25
  • 204
  • 289
  • Due to disk space limitations, I'd prefer to read from stdin. Do you have another suggestion. Thanks for the quick response.. – quicoju Dec 12 '11 at 04:19