How to do plotting on WSL (Windows Subsystem Linux)

Ok got it working on Win 10 Pro with WSL 1 (not 2) with Ubuntu WSL

Follow these steps

  1. Install qt5 with sudo apt-get install qt5-default
  2. Add a line: export DISPLAY=localhost:0.0 to ~/.bashrc . Either source ~/.bashrc or restart WSL for this to take effect
  3. Install VcXsrv. Please note that Xming didn’t work for me and only VcXsrv worked.
  4. Test it out using Plots; gr(); plot(1:3)

Yay!