2
votes

Would someone please elucidate the gnuplot binary format?

The goal is to plot two time series from a binary pipe as line graphs on the same graph. The series are float64's. I'm piping them in using something like:

plot "-" binary format="%float64" endian=big with lines

However, I don't understand what order the data should go in. In the above, I can specify array=10, and pipe in 10 numbers; this works. However, what about two series? And what if they are indexed differently?

Thanks in advance.

1

1 Answers

2
votes

You can use this for two series:

plot "-" binary format="%float64" record=10 endian=big with lines, 
     "-" binary format="%float32" record=20 endian=big with lines

I recommed you to use record instead of array, this way you can manually specify or operate the X axis value with the using ($0*2):1 command.

If they are indexed differently, for example interlaced, there is no way to indicate that to gnuplot. Just copy to the pipe the information twice and ignore the non-usefull part with an *:

plot "-" binary format="%float64%*float32" record=20 endian=big with lines, 
     "-" binary format="%*float64%float32" record=20 endian=big with lines

Anyway, gnuplot does not allow to represent two graphs with the same input data, so the data must be copyed twice most of the times.

Hope that helps!