You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be nice to be able to register artists with the legend on the fly rather than on creation (plt.plot(label='my-label')) or all at once (plt.legend([h1, h1], ['label1, label2'])). I think this would be helpful for managing multiple legends or to modify a third party legend.
You basically have to add a method Legend.add_entry(handle, label) that properly updates the internal state.
Side note: Likely needs some internal refactoring. We currently know the number of entries when we create the legend, and rely on that static information. There's for some up up-front setup in Legend._init_legend_box. Also auto-positioning is done on __init__ we need to decide whether adding an entry should trigger a new position search.
It'd be nice to be able to register artists with the legend on the fly rather than on creation (
plt.plot(label='my-label')
) or all at once (plt.legend([h1, h1], ['label1, label2'])
). I think this would be helpful for managing multiple legends or to modify a third party legend.Originally posted by @timhoffm in #29422 (comment)
The text was updated successfully, but these errors were encountered: