Ubuntu – Gnuplot display on Bash on Ubuntu on Windows 10

bashgnuplotwindows 10windows-subsystem-for-linux

Windows 10 Anniversary Update contains a Linux subsystem. I am in need of working in a Linux environment so I began looking into this subsystem. So far, I have been able to install all the needed applications. I successfully installed gnuplot and it runs just fine. However, I cannot set term to x11, and therefore I cannot plot anything to display. Following is the error:

Terminal type set to 'qt'
gnuplot> set term x11
Terminal type set to 'x11'
Options are ' nopersist enhanced'
gnuplot>
gnuplot: unable to open display ''
gnuplot: X11 aborted.

I tried installing Xming onto the same directory as the Bash program lies in Windows, but no luck. I really need gnuplot, and even though I can install it on Windows, it would be much more convenient to have it on the Linux subsystem.

How can I fix this display/x11(forwarding) issue?

Best Answer

(1) Install Xming. (2) execute export DISPLAY=:0 nameOfProgram (for example export DISPLAY=:0 gnuplot

Related Question