Sorry if I'm asking a stupid question here, but I'm a real noob concerning gnuplot so please be patient.
I have a set of data and tried to fit it with
f(x)=a * cos(x-b)**2 via a,b.
But it didn't work. It should look like this,

but it turned out like this

What could be the Problem with my fit equation?