Matplotlib Legend Tutorial || matplotlib legend outside of graph || Matplotlib Tips

Published: 18 January 2021
on channel: Kimberly Fessel
19,132
447

This matplotlib legend tutorial walks you through basic and advanced options for matplotlib legends using Python code for a series of matplotlib legend examples. I start from the basics including making a matplotlib legend and the label argument. I show you how to change the matplotlib legend order, and then we thoroughly discuss the matplotlib legend location. I also demo how you can move the matplotlib legend outside of the graph. We move on to making a matplotlib legend horizontal using the ncol keyword argument. Finally, we talk about styling the matplotlib legend including changing the matplotlib legend fontsize, other font properties, the label color, removing the border with frameon, and adding a title to the legend. Last but not least, I show you how to change the matplotlib legend background color with the facecolor argument.

0:00 Introduction
0:24 Legend Basics
1:50 Change Legend Order
2:38 Legend Location
3:41 Legend Outside Plot
5:07 Horizontal Legends
6:13 Legend Font Size, Properties, Color
7:12 Legend Border, Title
7:40 Legend Background Color
7:54 Conclusion

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

Related Videos:
Full Matplotlib Tips Playlist:    • Matplotlib Tips  
How to SAVE a matplotlib figure and FIX TEXT CUTTING OFF:    • How to save a matplotlib figure and f...  

#matplotlibtips #matplotlib #dataviz


Watch video Matplotlib Legend Tutorial || matplotlib legend outside of graph || Matplotlib Tips online without registration, duration hours minute second in high quality. This video was added by user Kimberly Fessel 18 January 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 19,132 once and liked it 447 people.