Running without reference to the X server will cause this problem. Usually ssh does not give you a link to the X server (but can be configured or switched for this). I find that I can duplicate the error quoted by "ssh localhost" and enter gnuplot and the graphing command, it will assume that wxt is a terminal type and will fail to initialize the wxWidgets and segfault error.
I think this will work for me if I do it first.
Warning: the first "xhost +" command is dangerous, it disables X protection and allows anything, anywhere on the Internet, to connect to a screen, keyboard or mouse. This may be less of a problem because the machine is located behind a network address router, such as that used on a home network.
From the shell:
xhost + export DISPLAY=:0.0
Run gnuplot programmatically, then send the gnuplot commands as usual.
It should work. Work for me at the moment in ssh login. If this is not the case, check the env that you use to start a new process and set "DISPLAY =: 0.0" there explicitly. This means connecting to a local display. Hostname can be added before:
On Linux, gnuplot usually searches for an X server. Perhaps he will not find it.
Perhaps if the goal is to save your charts in files, add:
set terminal png set output 'graph.png'
to your gnuplot commands before the "plot" command. This should work even on dumb servers.
If you want to control the output file name, just send another name instead of graph.png
source share