To add a legend to a matplotlib plot, one simply runs legend()
.
How to remove a legend from a plot?
(The closest I came to this is to run legend([])
in order to empty the legend from data. But that leaves an ugly white rectangle in the upper right corner.)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…