I am trying to create a contour plot with PGFPlots in VSCode. I am using the LaTeX Workshop extension. I have gnuplot installed. Also in case it matters, I am using Windows Subsystem for Linux 1 (WSL1). I have enabled shell escape too (and I know it is working because I've compiled files with the minted package just fine). Lastly, I am compiling with LuaLaTeX.

I have a main tex file and in that I have something like this

                xlabel = {X},
                ylabel = {Y}
            \addplot3 [
                contour gnuplot
            ] table {Code/Data.dat};

When I try to compile I get an error that main_contourtmp0.table could not be opened. That's because it is not being created. I can see that main_contourtmp0.dat and main_contourtmp0.script are both there in my file directory.

It seems that Latex Workshop cannot find gnuplot.

Any suggestions or thoughts on how I can correct it?

There is an env variable in the recipes section of LaTeX Workshop. Maybe I could append a path to /usr/local/bin/gnuplot or something like that?

  • I tried compiling with pdflatex and I get the error. Even though I have shell escape enabled, it can't find gnuplot, despite gnuplot being in the PATH. Really stumped here.
    – Nukesub
    Feb 20, 2021 at 15:09

1 Answer 1


I found the solution. You can read about it here. I had to run the following command since I am using WSL1.

sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5

After running this command it compiles just fine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .