I have tried to do a trapeze integration with f(x)=x^2, where I know how the antiderivative looks like, so F(x) = (1/3)x^3
Here's my code, just like I tried:
x = np.arange(-10,10, 0.01) # start,stop,step f = x**2 l=it.cumtrapz(f,x, initial=0) plt.plot(l)
Then I get this plot (1):
But the plot should look like this (2). The axis designations are different and the intersection point in the coordinate origin (0,0) is not the same as in (1).:
How can I achieve with my code that the graph from (1) looks exactly like (2)?