Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
\addplot
gnuplot[id=sin]{sin(x)};
\end{axis}
\end{tikzpicture}

\end{document}

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.

share|improve this question
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. –  Harish Kumar 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? –  Harish Kumar 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. –  Harish Kumar Jul 5 '13 at 10:48
show 7 more comments

1 Answer

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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