Why the following two MWE codes, using pgfplots with and without gnuplot give different results (a phase shift)?
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot [thick,mark=none,domain=0:6,samples=1000] {cos(deg(2*x+atan(1)))};
\end{axis}
\end{tikzpicture}
\end{document}
and
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot [thick,mark=none,domain=0:6,samples=1000] gnuplot {cos(2*x+atan(1))};
\end{axis}
\end{tikzpicture}
\end{document}
atan
gives its result already in degrees. I think you want to docos(deg(2*x)+atan(1))
. – Qrrbrbirlbel Sep 24 '13 at 23:48