# Incorrect plot values using pgfplots

I'm trying to plot the following function:

\begin{tikzpicture}
\begin{axis}[
ymin = 0, width=17cm, height=19cm, grid = major,
use units,  x unit=mm,  y unit=j.u, xlabel=x,  ylabel=I]

domain=-10:10,samples=120]
{ (sin(120*x)/(120*x)*cos(100*x))^2};

\end{axis}
\end{tikzpicture}


What I get is this: and what should I gest is that: They look pretty simmilar but the wrong figure y values ranges from 0 to 3x10^(-4) when they sould range form 0 to 1. I already solved the readian - degrees problem. But this one is something above my skilz :p.

• I dont think that's the problem. At x=0 sin(120*x)/(120*x) tends to unity so there is no singularity at this point. – Arthur Dec 29 '13 at 18:27
• I tried tweaking "samples". I got the same figure only smoother. "samples at" wont help either. – Arthur Dec 29 '13 at 18:31
• Are you sure that's the correct function? I get this Wolfram Alpha plot – percusse Dec 29 '13 at 18:48
• Your input is incorrect. It should be: Wolfram Alpha. I wonder If anyone tried my code and got the same result as mine. Anyone ? – Arthur Dec 29 '13 at 19:36

{(sin(120*x)*cos(100*x)/(120/180*3.14*x))^2};

• the deg/rad problem is huge, I agree. But how would you change it? Changing the default is impossible; it would break existing pictures. Adding a further option of sorts "trig unit=deg|rad" would be possible, but since it would not become a default, nobody would use it. Probably. Which way to "fix it" would you accept/expect as end-user? Something like \pgfplotsset{compat=1.9, trig unit=rad} in your preamble? that would be feasible... [this key does not exist currently!] – Christian Feuersänger Dec 30 '13 at 7:59