Im trying to run the following code
\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width = 7cm, compat = 1.8}
\begin{document}
\begin{tikzpicture}
\begin{axis}[domain = -2:2, domain y = 0:2*pi]
\addplot3[contour gnuplot = {output point meta = rawz, number=10, labels=false}, samples = 41, z filter/.code=\def\pgfmathresult{-1.6}] {exp(-x^2) * sin(deg(y))};
\addplot3[surf, samples = 25] {exp(-x^2) * sin(deg(y))};
\end{axis}
\end{tikzpicture}
\end{document}
and I'm getting the error
Package pgfplots Error: sorry, plot file{Utitlled_contourmp0.table} could not be opened
through a quick search I found out that contour maps require pgfplots and gnuplot to talk to each other. In theory the way to make them interact is adding
!TEX option = --enable-write18
or
%!TEX option = --enable-escape
at the top of the file. Unfortunately this has not worked for me. Any suggestions?
pdflatex -shell-escape
, it works beautifully. Perhaps this means you need to say!TEX option = -shell-escape
.% !TEX option = -shell-escape
before/after\begin{document}
, still no luck-
, i.e. use% !TEX option = --shell-escape
?)