# Problem with gnuplot on Texpad

I have been using Texpad (1.7.23) for quite some time now on a Mac without any problems. Recently I decided to try to draw my graphs on TikZ instead of drawing them somewhere else and importing them. So I followed these steps:

1. I installed gnuplot (5.0.3) running brew install gnuplot on terminal;
2. Tried to draw a simple function on terminal using gnuplot, worked fine;
3. On Texpad preferences, I allowed packages to use the --shell-escape directive.

The thing is when I try to run the example from the TikZ and PGF Manual:

\begin{tikzpicture}[domain=0:4]
\draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
\draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
\draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
\draw[color=red]    plot[id=x]   function{x}           node[right] {$f(x) =x$};
\draw[color=blue]   plot[id=sin] function{sin(x)}      node[right] {$f(x) = \sin x$};
\draw[color=orange] plot[id=exp] function{0.05*exp(x)} node[right] {$f(x) = \frac{1}{20} \mathrm e^x$};
\end{tikzpicture}


I always get the error message:

Package pgf Warning: Plot data file example.x.table' not found. on input line 40.

I have tried reinstalling gnuplot compiling from source with readline library, still get the same error message with and empty graph on the pdf.

Please enlighten me on what I might be doing wrong.

• Try disabling "Hide intermediate files". – Benjamin Mar 2 '16 at 18:27
• @Benjamin Tried it, didn't work. – gtovieira Mar 3 '16 at 20:09
• Does it work from the terminal with latexmk --shell-escape -pdf example.tex? – Benjamin Mar 3 '16 at 20:25
• @Benjamin it turns out that Texpad has two places where you can change the option to hide intermediate files, one in the preferences and the other on the compilation menu of the document itself. The first time I only changed it in the preferences pane. Now it worked! Thank you very much! – gtovieira Mar 3 '16 at 20:50

• Ok, so I tested it again using \usetikzlibrary{external}\tikzexternalize` and it also works for me. It actually now even works using Auto-Sense. Are you testing with a MWE? E. g. texample.net/tikz/examples/gnuplot-basics or is there some "unrelated" TeX-Code in your document. – Benjamin May 3 '17 at 19:59