# What is wrong with this code to plot '(y^2)/2-cos(x)'?

I want to contour plot the curves (y^2)/2-cos(x)=c with the following code, but there are only straight line in the output figure. What's wrong? Any help or suggestions will be appreciated!

\begin{tikzpicture}
\begin{axis}[domain=-10:10,view={0}{90}]
\end{axis}
\end{tikzpicture}

-
is it (y^2)/2 - cos(x) or y^(2/(2-cos(x))) or is it [1/(2-cos(x))]y^2 –  Nicholas Hamilton Oct 26 '13 at 2:24
@ADP Thanks! (y^2)/2 - cos(x). –  Eden Harder Oct 26 '13 at 2:28
PGFPlots uses degrees, so your domain is too small. –  Jake Oct 26 '13 at 7:12

PGFPlots uses degrees for trigonometric functions, not radians. You can convert your values to degrees using deg(x) instead of just x:

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[domain=-10:10,view={0}{90}, samples=60, samples y=60]

what is the reason that I get with xelatex a completely other output? I have current TL 2013. My output: perce.de/pub/xelatex.png –  Herbert Oct 26 '13 at 12:02
@Herbert thanks for the helpful question. That is a bug; the input file for gnuplot receives ^^I as column separator; but that does not seem to work in xelatex (which generates three separate chars). I will take care of it. –  Christian Feuersänger Oct 27 '13 at 18:21