Matplotlib Tutorial 25 - customizing Matplotlib Legends

preview_player
Показать описание
In this Matplotlib tutorial, we're going to be going over custom legends. We've covered the basics of adding a legend already.

The main issue with legends is typically that the legend gets in the way of data. There are a few options here. One option is to put the legend outside of the axis, but we have multiple subplots here and that would be pretty difficult. Instead, we'll make the legend a bit smaller, and then apply an alpha to it.

First, to have a legend, we need to add labels to our data that we want to show up on the legend.

Рекомендации по теме
Комментарии
Автор

3:19. With current version of Matplotlib (May 2018) you can just put add to ax_2v.fill_between option: label="something".

kamilziemian
Автор

Hasta este punto ha sido todo lo que he querido... Muchas gracias por todo el esfuerzo con estos tutoriales, son muy útiles.

Until this point it has been everything I wanted... Thank you so much for all the effort put in those tutorials, they're very useful.

julianurrea
Автор

to add to my previous question, its a live chart which needs to refresh every tick. So there is the price data which is stored in MySql and a couple of algorithms running at the back end server and that data is stored in mysql tables. I need to plot the price on top and the all the other data below the price (using multiple y axis.) Thanks in advance.

sanjayvenkatrao
Автор

Good work. I have two specific observations. If you have suggestions to circumvent please share.

1. fig.savefig() saves only after program execution terminates
.
2. Because sub plot 2 is dual y axis, only x value is displayed at right corner (on mouse over /movement)

Thanks
Venkat

AllisWell
Автор

Your videos are great! Sometimes I just think there is a bit too much talk in between unrelated things. Nice work and thanks!

mclarryvonnoobland
Автор

Bro, Could you help plot a graphs of curves about Time evolutions of state variables of 100 nodes with the small-world
network (c1 = 0.1 and c2 = 0) from multiagent networks pls

V.L.Siddarth
Автор

How do i plot this from a MySql database?

sanjayvenkatrao
Автор

I think that title of video should be "Matplotlib Tutorial 25 - Customizing Matplotlib legends". But these is minor detail.

kamilziemian