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:

\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$};

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

To summarize the comments: To plot functions with gnuplot in tikz using Texpad

  • Shell Escape has to be enabled and
  • Hide intermediate files has to be disabled

for the project.


  • Any tips for if this still isn't working? I've got the settings shown plus shell escape enabled and hide files disabled in the main settings.
    – Elliot G
    May 3 '17 at 19:35
  • @ElliotG I just checked it again. Still works fine for me. What's the error message you are getting?
    – Benjamin
    May 3 '17 at 19:45
  • Thanks for the reply. Ive got "Sorry, the system call 'pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "Final-figure0" "\def\tikzexternalrealjob{Final}\input{Final}"' did NOT result in a usable output file 'Final-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls."
    – Elliot G
    May 3 '17 at 19:46
  • Its actually rendering the Tikz correctly but not externalizing them (which saves a TON of time) and not outputting PDFs of each plot, which is helpful since you can copy them into presentations.
    – Elliot G
    May 3 '17 at 19:47
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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