6

I'm reproducing the following example from pgfplots manual.

\begin{tikzpicture}
\begin{axis}[view={0}{90}]
\addplot3[contour gnuplot]
{x*y};
\end{axis}
\end{tikzpicture}

But this code produces the following error:

Package pgfplots Error: sorry, plot file{Example_contourtmp0.table} could not be opened.

I would highly appreciate if you point me what I'm missing. Thanks

P.S. I'm using MikTex 2.9 on Windows 7.

Edit

Following @hpesoj626 guidelines, I got the following error message.

enter image description here

MYaseen208
  • 8,587
  • 5
    You need to have gnuplot installed, and you need to have write18 enabled in order to be able to call gnuplot from within LaTeX. Could you check whether there's a line like runsystem(gnuplot "texse2_contourtmp0.script")...executed. in your .log file? – Jake Jan 02 '13 at 14:42
  • Thanks @jake for showing interest in my problem. Is there any specific way to install gnuplot? I'd highly appreciate if you provide some guidelines to install gnuplot. Thanks – MYaseen208 Jan 02 '13 at 14:47
  • Are you using Windows or Linux? – Jake Jan 02 '13 at 14:48
  • You can download the latest Windows version of gnuplot (4.6.0) at https://sourceforge.net/projects/gnuplot/files/gnuplot/4.6.0/ (the file is called gp460-win32-setup.exe). – Jake Jan 02 '13 at 14:53
  • Thanks @jake, I've installed gnuplot. What's next please? – MYaseen208 Jan 02 '13 at 15:16
  • 1
    I assume since you have posted the bounty that this is still unsolved. Please clarify what progress you have made since asking the question and what troubles you are still having? You have installed gnuplot, compiled with --enable-write18 and you get the same error? Can you include any other information that might be helpful, for example a complete MWE (beginning with \documentclass and ending in \end{document}), and your log file? To help identify where the problem lies, have you tried compiling it from the command line or only through your editor? – cyberSingularity Jan 09 '13 at 18:13
  • What text editor are you using? You can open your command prompt by clicking Start Menu and typing cmd then Enter. In the terminal, go to your working directory by typing cd nameofdirectory then run pdflatex --enable-write18 yourfilename.tex or pdflatex --shell-escape yourfilename.tex – hpesoj626 Jan 10 '13 at 03:23
  • Thanks @hpesoj626 for your comment and I'll test your commands. I am using TeXnicCenter. Thanks – MYaseen208 Jan 10 '13 at 11:29
  • Hello @hpesoj626, please see my edited question and suggest accordingly. Thanks – MYaseen208 Jan 10 '13 at 18:27
  • You probably need to set the path (windows cannot find gnuplot, if is not on the path) http://www.computerhope.com/issues/ch000549.htm – yannisl Jan 10 '13 at 18:35
  • 1
    Thanks @YiannisLazarides for your comment. Even though I set the path but it was not working due to an extra space. After removing the extra space, now it works. Thanks all of you for your help and sparing time. Much appreciate. – MYaseen208 Jan 10 '13 at 19:20
  • 1
    @MYaseen208 OK I will provide a bit of a longer answer tomorrow so that we can leave a reference for anyone looking for a similar problem in the future. – yannisl Jan 10 '13 at 19:24

1 Answers1

7

You need to ensure that the path is set correctly. One of the most common frustrations with Windows is the tiny text box used for setting up paths. For any executable to be found one needs to set the "path." Different versions of Windows have slightly different ways to navigate to the input screen, so is best to rather click on "control panel" and search.

An easy way to see, if a path was set-up correctly is to fire up a command prompt console and to type path:

enter image description here

As you can see, easy is an understatement, as is all cluttered under anything close to defaults. If you right click at the top left of the console you can set your console to something larger. You can also adjust some colours if you wish. Good inspiration for color schemes can be found at the sublime2 editor.

A good standalone "Gnuplot" comes bundled with Octave and all necessary settings for windows.

yannisl
  • 117,160