# Gnuplot invisible

I'm trying to plot two implicit curves (using pgfplots and raw gnuplot) but they don't appear in the document. In gnuplot it works just fine so I guess it has something to do with pgfplots but i can't figure out, what the problem is.

Example:

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
unset key
set contour base;
set cntrparam levels discrete 0.003;
unset surface;
set view map;
set isosamples 50,50;
set xrange [0:1]
set yrange [-1:1]
f(a,c) = a*cosh(c/a)-N
ell1(a,c) = (c/z)**2+(1/(1-cosh(z)))**2*(a-N/(cosh(z)))**2-(N/cosh(z))**2
N = 1
z = 1.19968
splot f(x,y),ell1(x,y)
};
\end{axis}
\end{tikzpicture}
\end{document}

-
add the missing ; at the end of each command, then it should work –  texenthusiast Aug 6 '13 at 8:02
oh indeed. i thought they are optional as gnuplot didn't need them. Do you want to answer this or shall i flag my question for deletion? –  oerpli Aug 6 '13 at 8:11
retain the question as it might look silly mistake ( sometimes silly can be brilliant) but someone may be in the same situation would benefit. I made the answer with the plot, hope it's the plot you are looking for –  texenthusiast Aug 6 '13 at 8:24
okay. thanks a lot. –  oerpli Aug 6 '13 at 8:29

If you notice ur-file-name.pgf-plot.gnuplot created by first pdflatex -shell-escape ur-filename.tex compilation there is a missing ; at the end of each gnuplot command, then it may not work like in a terminal gnuplot(eg: command by command execution) as ; command line terminator is required to separate the gnuplot commands when fed in a file to gnuplot.

\documentclass[convert=false,border=2pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\begin{document}
\begin{tikzpicture}
\begin{axis}
unset key;
set contour base;
set cntrparam levels discrete 0.003;
unset surface;
set view map;
set isosamples 50,50;
set xrange [0:1];
set yrange [-1:1];
f(a,c) = a*cosh(c/a)-N;
ell1(a,c) = (c/z)**2+(1/(1-cosh(z)))**2*(a-N/(cosh(z)))**2-(N/cosh(z))**2;
N = 1;
z = 1.19968;
splot f(x,y),ell1(x,y);
};
\end{axis}
\end{tikzpicture}
\end{document}


Output:

-