How to Fill Between Multiple Lines in Matplotlib?
With the use of the fill_between() function in the Matplotlib library in Python, we can easily fill the color between any multiple lines or any two horizontal curves on a 2D plane.
Syntax: matplotlib.pyplot.fill_between(x, y1, y2=0, where=None, step=None, interpolate=False, *, data=None, **kwargs)
Example 1: Color between the curve of the mathematical function f(x)=sin(x)
Example 2: Color between the curve of the mathematical function f(x)=cos(x) and f(x)=exp(x) :-
Example 3: Color the Rombus :-
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course