我想使用 matplotlib 来说明两个区域之间的定积分:x_0 和 x_1。
给定以下图,如何在 matplotlib 中从 x=-1 到 x=1 对曲线下的区域进行阴影处理
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))
原文由 lukecampbell 发布,翻译遵循 CC BY-SA 4.0 许可协议
查看
fill
。下面是一个填充受限区域的 示例。