The following code is from the "gallery of examples in the manual - PGFPlots".
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
title={$x \exp(-x^2-y^2)$},
domain=-2:2,enlarge x limits,
view={0}{90},
]
\addplot3[contour gnuplot={number=14},thick]
{exp(0-x^2-y^2)*x};
\end{axis}
\end{tikzpicture}
\end{document}
Unfortunately the code does not work and I get the following error message:
! Package pgfplots Error: sorry, plot file{example_175_contourtmp0.table} could
not be opened.
See the pgfplots package documentation for explanation.
Type H <return> for immediate help.
...
l.17 {exp(0-x^2-y^2)*x};
?
! Emergency stop.
...
l.17 {exp(0-x^2-y^2)*x};
End of file on the terminal!
I have no idea what could be the problem. It would be great if anbody can offer a solution.

pgfplotsis quite misleading, I fear. It should have been "I was unable to read the output of gnuplot". Problems can be: there is nognuploton the system or, (b) gnuplot could not be executed (see the answer of @aeronotauto). The commandcontour gnuplotis supposed to make a system call (which needs-shell-escape) in order to invokegnuplot-- in the hope that this command is available. Does you.logfile contain any indication ofgnuplotinvocations or system calls (try searching for these keywords in your.logfile)? – Christian Feuersänger May 04 '15 at 19:16runsystem(gnuplot "example_175_contourtmp0.script")...disabled (restricted).in the.logfile. Maybe this helps you. – user144921 May 04 '15 at 19:37-shell-escape(or, in some TeX installations on windows,-enable-write18) to youlatexinvocation. Please refer to the answer of @aeronotauto for details. – Christian Feuersänger May 06 '15 at 15:51-shell-escape,--shell-escapeand-enable-write18. But the error still appears. – user144921 May 08 '15 at 18:19...disabled (restricted)in your log file? – Christian Feuersänger May 10 '15 at 18:35