In this recipe, we will learn how to plot a defined area under a curve and embed the equation as text on the plot.
Plotting area under an integral curve
Getting ready
Import the required libraries:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
How to do it...
The following code block plots a polynomial of the third y = x ** 3 order and plots the area under this curve between two points on the x axis, which is the integral of the function limited by the two points:
- Define two points a and b that are the limits of integral being...