Matplotlib Tutorial (Part 5): Filling Area on Line Plots




[ad_1]

In this video, we will be learning how to fill between our line plots in Matplotlib.

This video is sponsored by Brilliant. Go to https://brilliant.org/cms to sign up for free. Be one of the first 200 people to sign up with this link and get 20% off your premium subscription.

In this Python Programming video, we will be learning how to fill between our line plots in Matplotlib. Not only can this make our graphs look more professional, but we can also add useful information by filling areas based on specific thresholds. Let’s get started…

The code from this video (with added logging) can be found at:
http://bit.ly/Matplotlib-05

✅ Support My Channel Through Patreon:
https://www.patreon.com/coreyms

✅ Become a Channel Member:
https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join

✅ One-Time Contribution Through PayPal:
https://goo.gl/649HFY

✅ Cryptocurrency Donations:
Bitcoin Wallet – 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet – 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet – MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey’s Public Amazon Wishlist
http://a.co/inIyro1

✅ Equipment I Use and Books I Recommend:
https://www.amazon.com/shop/coreyschafer

▶️ You Can Find Me On:
My Website – http://coreyms.com/
My Second Channel – https://www.youtube.com/c/coreymschafer
Facebook – https://www.facebook.com/CoreyMSchafer
Twitter – https://twitter.com/CoreyMSchafer
Instagram – https://www.instagram.com/coreymschafer/

#Python #Matplotlib

Source


[ad_2]

Comment List

  • Corey Schafer
    November 20, 2020

    Hey Corey, I'm unable to open the csv file even after saving that and using pd.read_csv('…..')
    it's showing the following error :
    ParserError: Error tokenizing data. C error: Expected 1 fields in line 3, saw 3

    What should I do ?

  • Corey Schafer
    November 20, 2020

    Thanks man!!

  • Corey Schafer
    November 20, 2020

    Th Best MatplotLib Tutorial on Youtube right now. Trust me. I have searched for and watched a lot of tutorial videos on this module.

  • Corey Schafer
    November 20, 2020

    You r the great man ,after looking ur lecture my energy boost ,pls upload more on other library of ml

  • Corey Schafer
    November 20, 2020

    1 dislike ! You should try entering Guiness World Record for the best likes / dislikes ratio ! As always : incredibly clear videos ! Keep up the super good work, I love what you do !

  • Corey Schafer
    November 20, 2020

    Damn. I love this guy! ❤️

  • Corey Schafer
    November 20, 2020

    Hey , i am facing this error when using fill_betwen command TypeError: '>' not supported between instances of 'list' and 'int'

  • Corey Schafer
    November 20, 2020

    Thank you very much Sir

  • Corey Schafer
    November 20, 2020

    The thing that makes you unique is the way that you simplify and organize everything and explain it as clear as possible. Thank you!

  • Corey Schafer
    November 20, 2020

    How do you clean the data from the survey data?
    If anybody knows , please comment

  • Corey Schafer
    November 20, 2020

    OMG,why this dont have subtitles

  • Corey Schafer
    November 20, 2020

    I was having a hard time understanding matplotlib visualization codes before I started watching this video series. Thanks, Corey!

  • Corey Schafer
    November 20, 2020

    My matplotlib showing the same color above and below even if i specified the condition,
    any suggestions,what's wrong?

  • Corey Schafer
    November 20, 2020

    Thank you! Your tutorials are so helpful!

  • Corey Schafer
    November 20, 2020

    Hey Corey. Did you create the CSV file of the data yourself from the survey data or did you obtain it from any source? I tried to create this same CSV file myself for practice by grouping the data according to age but couldn't. So, could you help me out?

  • Corey Schafer
    November 20, 2020

    so good!

  • Corey Schafer
    November 20, 2020

    For those who want to run script in sublime text on Mac, install one package and you're good to go. To do that follow these:
    1. Open Command Palette(In Menu > Tools > Command Palette or simply type shift command p)
    2. Type install package and choose 'Package Control: Install Package'
    3. Type 'SublimeREPL' and install it by hitting it
    4. Open Build(Menu > Tools > Build or type comma b). You just ran your code in sublime text.

  • Corey Schafer
    November 20, 2020

    Great video!

  • Corey Schafer
    November 20, 2020

    Hello Corey, I wanted to know why when I run the script the graph window pops out of my pycharm window? what i do wrong? and your videos really help me. thank you

  • Corey Schafer
    November 20, 2020

    635 likes and 0 dislikes say a lot about this video!

  • Corey Schafer
    November 20, 2020

    why there's no subtitle in this video and the previous one ?

  • Corey Schafer
    November 20, 2020

    Hey, I am not getting the different colors getting filled in even though I mentioned different values.
    plt.fill_between(ages_x, py_dev_y, dev_y,

    where=(py_dev_y <= dev_y),

    interpolate=True, color='red', label='Below Avg')

    plt.fill_between(ages_x, py_dev_y, dev_y,

    where=(py_dev_y > dev_y),

    interpolate=True, color = 'yellow', label='Above Avg')
    I am getting only YELLOW color above and below the crossing point. Can anyone help me with this?

  • Corey Schafer
    November 20, 2020

    I am following using the Jupiter Notebooks. It is so great to see the plots popping up. Love this series! 😍

  • Corey Schafer
    November 20, 2020

    How can I download CSV file

  • Corey Schafer
    November 20, 2020

    Hey Corey,
    Maybe I'm dumb, but I can't get the point of using interpolate parameter in the fill_between method, can you explain it a little more?
    BTW, Thanks a lot for the matplotlib tutorial series, they are fantastic.
    And I have a tutorial request too, about sockets in python, creating servers, clients. I would be so happy if you put them in your future videos, of course, I know that you are busy with pandas tutorial right now.

  • Corey Schafer
    November 20, 2020

    Hey Corey, great video! I'm having trouble doing this with a timeseries as the x-axis, could you do a video with that?

  • Corey Schafer
    November 20, 2020

    Thank you very much for your video. However, when I try to use another method with csv to read the file to make the list. It shows me the error with File "sample.py", line 26, in <module>
    py_salaries > overall_median), interpolate=True, alpha=0.25)
    TypeError: '>' not supported between instances of 'list' and 'int'?
    What should I do to correct this kind of error?

  • Corey Schafer
    November 20, 2020

    It is so amazing to view your method of teaching. Very simple and easy to understand. Awesome, thanks corey. You are my hero.

  • Corey Schafer
    November 20, 2020

    did you manually work out the median to be 57287?

  • Corey Schafer
    November 20, 2020

    beat from all video

Write a comment