TF1 Draw does not plot correct cosine function

I am trying to fit data points with a cosine function, with decaying amplitude. If I fit and plot short range, this looks fine:

However, if I increase the time range I get this:

Here the fit function (red) does not look like a cosine function at all. How is that possible?

I think I fixed this myself with the function SetNpx().

1 Like