How to add shading to matplotlib figures and fill between two lines || Matplotlib Tips

Kimberly Fessel
Kimberly Fessel
5.9 هزار بار بازدید - 4 سال پیش - Learn how to fill the
Learn how to fill the area between two lines and add shading to your Python matplotlib figures with this Matplotlib Tips tutorial.  First I show you the basics of how to create shading on your matplotlib figures with pyplot axvspan and axhspan to create vertical and horizontal shading, respectively.  Both of these functions help you use matplotlib to fill the area between two lines.  Then I demonstrate some styling tips like changing the matplotlib shading color or transparency.  We also add a pattern to the shading polygon with set_hatch().  Finally, I show you how to use pyplot's fill_between function to fill the area between more complicated curves.  

0:00 Introduction
0:31 Coding Basics: axvspan, axhspan
2:43 Styling: color and alpha
4:41 Styling: polygon options, hatch
5:17 Coding fill_between

Github Code:
https://github.com/kimfetti/Videos/bl...

Related Videos:
* Add TEXT:  Add TEXT to MATPLOTLIB figures || Pyt...
* Add PATTERNS: How to add PATTERNS to matplotlib fig...
* Axes limits:  How to change the axes limits of a ma...
* Full Matplotlib Tips Playlist: Matplotlib Tips

#matplotlibtips #matplotlib #dataviz
4 سال پیش در تاریخ 1399/12/18 منتشر شده است.
5,971 بـار بازدید شده
... بیشتر