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
The handles parameter for mpl.legend.Legend is typed as Iterable[Artist], but I believe that legend handles can also be artist tuples to produce a combo legend annotation?
Code for reproduction
# This works anywayimportmatplotlibasmplimportmatplotlib.pyplotaspltf, ax=plt.subplots()
h1=mpl.lines.Line2D([], [])
h2=mpl.patches.Patch(alpha=.2)
ax.legend(handles=[(h1, h2)], labels=["combo artist"])
Actual outcome
MyPy error when I pass a list of artist tuples to mpl.legend.Legend.
Expected outcome
I think this is valid matplotlib?
Additional information
Sorry the bug report template isn't the ideal format for this.
Operating system
No response
Matplotlib Version
3.8.0rc1
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered:
Bug summary
The
handles
parameter formpl.legend.Legend
is typed asIterable[Artist]
, but I believe that legend handles can also be artist tuples to produce a combo legend annotation?Code for reproduction
Actual outcome
MyPy error when I pass a list of artist tuples to
mpl.legend.Legend
.Expected outcome
I think this is valid matplotlib?
Additional information
Sorry the bug report template isn't the ideal format for this.
Operating system
No response
Matplotlib Version
3.8.0rc1
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered: