Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack.
To create filled polygons between two curves a PolyCollection filling needs to be created between y1 and y2.
Parameters for the above task:
- x: It is an array of length N that holds data of x.
- y1: It is an array or a scalar of length N that holds data of y.
- y2: It is an array or a scalar of length N that holds data of y.
Below is the implementation.
Enter values of X array: 1 2 3 Enter values of Y1 array: 1 2 1 Enter values of Y2 array: 1 4 1 Enter color: red
Enter values of X array: 1 2 3 4 5 Enter values of Y1 array: 1 2 3 2 1 Enter values of Y2 array: 3 5 7 5 3 Enter color: blue
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.
- Make filled polygons between two curves in Python using Matplotlib
- How to plot Andrews curves using Pandas in Python?
- Using Learning Curves - ML
- Rhodonea Curves and Maurer Rose in Python
- Plotting polar curves in Python
- Python Bokeh - Plotting Quadratic Curves on a Graph
- Python | Detect Polygons in an Image using OpenCV
- Calibration Curves
- Python | Ellipse (different polygons) in Kivy
- Python Bokeh - Plotting Multiple Polygons on a Graph
- How to Make Horizontal Violin Plot with Seaborn in Python?
- Filled area chart using plotly in Python
- Plot a Horizontal line in Matplotlib
- Create a Numpy array filled with all zeros | Python
- Draw Color Filled Shapes in Turtle - Python
- Numpy MaskedArray.filled() method - Python
- numpy.ma.filled() function - Python
- How to draw color filled star in Python-Turtle?
- Horizontal Boxplots with Points using Seaborn in Python
- Create a Numpy array filled with all ones
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.