To add a legend to a matplotlib plot, one simply runs legend().
legend()
How to remove a legend from a plot?
(The closest I came to this
you have to add the following lines of code:
ax = gca() ax.legend_ = None draw()
gca() returns the current axes handle, and has that property legend_