As we could see at the code below that the animation part is in
ani = animation.FuncAnimation(fig, animate, np.arange(-10,10), interval = 25, blit=False)
What about our own def? We could call it inside animate and use variable i (defined in ani, the np.arange(-10,10) part) to whatever treatment on our self define function f(x). In this case, I use i as c parameter value. I like the result, :)