Notes: I'm using Windows 8 and TeXworks. Also, I have never used gnuplot by itself, so I am unfamiliar with it.

I'm trying to use PGFPlots with gnuplot to graph functions. I have not been able to make anything work at all. I'm reading the PGFPlots manual, but I can't make heads or tails from the instructions.

This is the MWE given in the manual:






Which SHOULD create this: enter image description here

However, I get nothing except an error: enter image description here

I tried modifying TeXworks in the following manner as the PGFPlots manual discussed, trying all the variations I could think of with pdflatex -shell-enable, -shell-enable --shell-enable -enable-write18, ad nauseum. Nothing worked.

Update: I've additionally tried writing --shell-escape or --enable-write18, and placing these before $fullname. Still, I am getting the same error. enter image description here

I've additionally tried running these commands from the commandline, which does not seem to work either. The most I get is the request to install a package called dehyph-exptl, which is already installed. I have administrator privileges as well, so that's not the issue. In case you were wondering, dehyph-exptl has to do with the special hyphenation of German words apparently? No clue why this package is so important to run gnuplot via TeXworks. enter image description here

Lastly, here is evidence that I probably have gnuplot installed and working correctly, however..I know so little about computers that I can't be sure: enter image description here enter image description here

What am I doing wrong? Can anybody step me through this? I've searched online and in the manuals and haven't found any answers.

  • 1
    Sorry for the trivial question, are you sure you have gnuplot and that it's working? P.S. it's gnuplot, not GNUPlot nor GNU plot, it has nothing to do with GNU project. – giordano Jul 5 '13 at 9:41
  • Thanks, I'll make the correction. I think I have gnuplot and that it's working. i.imgur.com/4u3UAUJ.png; i.imgur.com/XjlaY3R.png – JDG Jul 5 '13 at 9:52
  • 1
    gnuplot should be added to the system path and you should compile with pdflatex --shell-escape yourfile.tex where `yourfile.tex is the above code. – user11232 Jul 5 '13 at 9:59
  • 1
    You can also check the path requirement by opening command prompt and type gnuplot --version. what do you get? – user11232 Jul 5 '13 at 10:01
  • 1
    Your gnuplot is not in the system path. You can either do it by adding your self (you may like this tool: redfernplace.com/software-projects/patheditor) or you may re-install gnuplot. There will an option to add it to the system path. Read carefully every instruction in every step of installation to find that option. You can use the pdflatex command from texmaker itself. – user11232 Jul 5 '13 at 10:48

The solution from Harish Kumar:

When installing gnuplots, you must check the following box. That is all that is necessary.

enter image description here

gnuplots is so awesome:

enter image description here


I've strugled with the same problem and still got the same error message after making sure gnuplot was installed correctly. My problem was writing the right thing under Tool configuration of pdfLaTeX. I had to write -enable-write18 after $fullname and then it worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.