# [OS X TeX] Gnuplot call from within pgfplot

Herbert Schulz herbs at wideopenwest.com
Fri Sep 13 07:43:20 EDT 2013

On Sep 13, 2013, at 6:08 AM, Joshua Smith <smithjh at lafayette.edu> wrote:

> All,
>
> I am trying to use pgfplots to create a figure, and I am calling gnuplot to evaluate a specified function to create the data, as follows:
>
> \begin{tikzpicture}
>   \begin{axis}[xmin=0, xmax=0.011, ymin=0, ymax=1.1, scaled x ticks=base 10:3, xtick scale label code/.code={}]
>     \addplot[\red, very thick] gnuplot[id=convection10, domain=0:0.010, samples=100] {(cosh(sqrt(4 * 100 / 14 / 0.005) * (0.010 - x)) + (100 / sqrt(4 * 100 / 14 / 0.005) / 14) * sinh(sqrt(4 * 100 / 14 / 0.005) * (0.010 - x))) / (cosh(sqrt(4 * 100 / 14 / 0.005) * 0.010) + (100 / sqrt(4 * 100 / 14 / 0.005) / 14) * sinh(sqrt(4 * 100 / 14 / 0.005) * 0.010))};
>   \end{axis}
> \end{tikzpicture}
>
> I have installed gnuplot and I can call it manually from a Terminal window.  However, when I compile my TeX file using TeXShop, I get the error:
>
> ./09-13-2013 Main.tex:349: Package pgfplots Error: Sorry, the gnuplot-result file '"09-13-2013 Lecture Notes.convection10.table"' could not be found. Maybe you need to enable the shell-escape feature? For pdflatex, this is '>> pdflatex -shell-escape'. You can also invoke '>> gnuplot <file>.gnuplot' manually on the respective gnuplot file..
>
> WIthin TeXShop, the engine is set to be
>
> pdflatex --file-line-error --synctex=1 --shell-escape
>
> so, why is gnuplot not being called automatically?
>
> Thanks,
> Josh

Howdy,

Could you provide a complete, minimal example that shows this behavior so I can see all the contents of a file that produces this error?

Also, what do you mean by the engine is set to be

pdflatex --file-line-error --synctex=1 --shell-escape

and what version of TeXShop and TeX Distribution are you using?

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)

`