Which package? What does “plotting not working” mean? You can’t save plots? You can’t display them interactively? Something else?
I think for displaying plots things are quite limited, I think the only option that might work is if the plot package just writes an HTML file and opens that. But anything more fancy, with a custom UI etc., won’t work because WSL doesn’t support software that shows a UI, as far as I know.
I got something to work with VegaLite.jl and VS Code. Here is how:
Installed VS Code on Windows, and then added the Julia and Remote - WSL extension to it.
I made sure Julia is on the PATH in WSL.
I type code from my ~ home directory in WSL. That starts the VS Code in Windows, connected to WSL.
I go to extensions and make sure the Julia extension is installed on the remote system.
I start a Julia REPL inside VS Code. This is running in WSL.
I install VegaLite#master (probably also works with the currently tagged version), and then everything works. Plots show in the VS Code Julia plot pane.
My best guess is that this also works with other plotting packages.
I think there is actually room for a nice little display package, say WebDisplay.jl. It could push a display onto the multimedia stack, start a web server and then show any plot that is pushed to that display in some web page. Essentially something like ElectronDisplay.jl, but for a remote scenario.
It might be useful for the WSL scenario, but also for a scenario with a headless remote server: one could SSH into the server, do some stuff interactively, and then browse to some URL on that server to look at the plots.
I also had to set up plotting for wsl (2). qt5-default is not available nowadays in ubuntu 22. So i found this guide: WSLでJuliaを使う #WSL - Qiita (with help of google web translate)
which is very similar to your setup but in step 1) installs the GR framework instead (Julia Package GR — GR Framework 0.73.6 documentation). on ubuntu this would be: apt install libxt6 libxrender1 libxext6 libgl1-mesa-glx libqt5widgets5
the rest in the guide is the same but a bit more explicit and verbose