Plotting binary data read from stdin does not work in gnuplot 5.4.5. Git master [89a9ddc8964a80b42270dd66990c8c0f635f138d] (5.5.0) does not have this problem (works correctly).
1) Save the following text into file 'test-gnuplot.c'.
#include <stdio.h>
int main()
{
const int n = 11;
float x, y;
printf("set term windows\n");
printf("plot \"-\" binary record=%d w linesp\n", n);
for (int i=0; i<n; i++) {
x = i; y = x*x;
fwrite(&x, sizeof(float), 1, stdout);
fwrite(&y, sizeof(float), 1, stdout);
}
fflush(stdout);
getchar();
return 0;
}
2) Compile 'test-gnuplot.c' with gcc test-gnuplot.c -o test-gnuplot.
3) Run ./test-gnuplot | gnuplot.
4) The graph does not appear with gnuplot 5.4.5.
I have tested on 5.4.x binaries.
The graph appears with 5.4.1, and 5.4.2 .
The graph does not appear with 5.4.3, 5.4.4, and 5.4.5 .
I cloned the latest stable branch source.
git clone -b branch-5-4-stable git://git.code.sf.net/p/gnuplot/gnuplot-main
git log
The graph appears using the above.
Last edit: Tatsuro MATSUOKA 2022-10-29
Thanks! I also can confirm that the issue is already fixed in branch-5-4-stable (5.4.6 alpha). So, we can expect the issue will most likely not occur in the next release.
Oh, v5.4.5 was not applied the following commit yet.
I see.