When I use '-' to plot in gnuplot from a pipeline, as follows⭐:
$ seq 5 | gnuplot -e "plot '-' w lp; pause 99"
it works fine, I can adjust the plot's window size, can show/hide grid without any problem.
But when I use '/dev/stdin' as follows:
$ seq 5 | gnuplot -e "plot '/dev/stdin' w lp; pause 99"
It shows the plot but when I click to maximize the window, it crashes:
line 0: warning: Skipping data file with no valid points
plot '/dev/stdin' w lp
^
line 0: x range is invalid
Could you please explain why does this happen? what is the difference between '-' and '/dev/stdin'?
⭐ I am deliberately using pause instead of using -p option, because the latter doesn't allow interaction with the plot (no update after resize, can't show/hide grid from the toolbar,etc.)
👉️ I am using bash version 5.0.17 on Ubuntu 20.04, gnuplot 5.2 patchlevel 8, if that info is needed.
'-', but that it doesn't mention/dev/stdina single time./dev/stdinwith gnuplot's stdin redirected from one) seems to work fine. Stracing it shows that gnuplot tries to open/dev/stdinmultiple times when called with... | gnuplot ... plot '/dev/stdin', so it appears that it misidentifies the pipe as a regular file.