Closed
Description
Bug report
figure.legend no longer accepts "handles" and and "labels" as keywords
Code for reproduction
# Paste your code here
#
#
fig.legend(
handles = patches,
labels = labels,
...)
**Actual outcome**
<!--The output produced by the above code, which may be a screenshot, console output, etc.-->
If applicable, paste the console output here
~/Python/lib/python3.6/site-packages/matplotlib/figure.py in legend(self, *args, **kwargs)
1523 '(artist handles, figure labels, legend location)')
1524
-> 1525 l = Legend(self, handles, labels, **kwargs)
1526 self.legends.append(l)
1527 l._remove_method = lambda h: self.legends.remove(h)
TypeError: init() got multiple values for argument 'handles'
**Expected outcome**
<!--A description of the expected outcome from the code snippet-->
<!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on-->
**Matplotlib version**
<!--Please specify your platform and versions of the relevant libraries you are using:-->
* Operating system: Fedora 26
* Matplotlib version: 2.1
* Matplotlib backend (`print(matplotlib.get_backend())`): TkAgg
* Python version: 3.6.3
* Jupyter version (if applicable):
* Other libraries:
<!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda-->
<!--If you installed from conda, please specify which channel you used if not the default-->
**Fix**
if handles and labels are provided as kwargs, use these and pop from kwargs.
Metadata
Metadata
Assignees
Labels
For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.