hbui
2024-07-19 5c28e0abb061a32f61ad0626cbba64a1fbcd4576
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import matplotlib.pyplot as plt
 
from numint.RiemannSum import numint
 
def main():
    def f(x): return x**3
    (a,b) = (1,2)
    (x, y, l, r, n) = numint(f, a, b, 0.5)
    # print(l, r, n)
    plt.step(x, y,               label="x^3")
    plt.step(x, y, where="post", label="x^3")
    plt.plot(x,y, color="gray", alpha=0.3)
    plt.show()
    pass