# How can I setup PGFPlots to work with gnuplot?

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:

\documentclass{memoir}

\usepackage{pgfplots}
\pgfplotsset{compat=1.8}

\begin{document}

\begin{tikzpicture}
\begin{axis}
gnuplot[id=sin]{sin(x)};
\end{axis}
\end{tikzpicture}

\end{document}


Which SHOULD create this:

However, I get nothing except an error:

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.

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.

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:

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.

-
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
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. –  Harish Kumar Jul 5 '13 at 9:59
You can also check the path requirement by opening command prompt and type gnuplot --version`. what do you get? –  Harish Kumar Jul 5 '13 at 10:01
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. –  Harish Kumar Jul 5 '13 at 10:48