I have to draw a lot of PDF and CDF graphs in my document/presentation and in order to do that I installed gnuplot. In order to install gnuplot I took the following steps:
1- Download the sources from : gnuplot sources then put the folder gnuplot-4.4.3 on my desktop
2- $ cd /Users/.../Desktop/gnuplot-4.4.3
3- $ ./configure --with-readline=builtin
4- $ make
5- $ sudo make install
6- test of gnuplot $ gnuplot
gnuplot works from Terminal. However, I get a lot of error running the followingMWE
\documentclass{minimal}
\usepackage{amsmath}
\usepackage{pgfplots}
\def\cdf(#1)(#2)(#3){0.5*(1+(erf((#1-#2)/(#3*sqrt(2)))))}%
% to be used: \cdf(x)(mean)(variance)
\DeclareMathOperator{\CDF}{cdf}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
xlabel=$x$,
ylabel=$\CDF(x)$,
grid=major]
\addplot[smooth,red] gnuplot{\cdf(x)(0)(1)};
\addplot[smooth,blue]gnuplot{\cdf(x)(0.5)(1)};
\addplot[smooth,green]gnuplot{\cdf(x)(1)(1)};
\addplot[smooth,orange]gnuplot{\cdf(x)(2)(1)};
\end{axis}
\end{tikzpicture}
\end{document}
The error that I get is
pgfplots: Sorry, the gnuplot-result file 'texstudio_DH7974.pgf-gnuplot <file>.gnuplot' manually on the respective gnuplot file.. \addlegendentryexpanded{$k = \k$}}
or code given in plotting chi-square. I guess I am missing one (or maybe cuple) of steps installing gnuplot. I really appreciate if you help.
pdflatexcommand with the--shell-escapeoption. Can you check your TeXStudio preferences to see if that's the case? – Alan Munn Dec 17 '12 at 03:00--shell-escapeto the line forpdflatex. – Alan Munn Dec 17 '12 at 03:11/usr/texbin/pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex. Again, THANK YOU! – N Nik Dec 17 '12 at 03:25