I want to use matplotlib to illustrate the definite integral between two regions: x_0, and x_1.
How can I shade a region under a curve in matplotlib from x=-1, to x=1 given the following plot
import numpy as np
from matplotlib import pyplot as plt
def f(t):
return t * t
t = np.arange(-4,4,1/40.)
plt.plot(t,f(t))
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…