Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2bddb79

Browse files
committed
MNT : removed code deprecated in 1.4
no longer accept positional pos value
1 parent 403118d commit 2bddb79

1 file changed

Lines changed: 2 additions & 21 deletions

File tree

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -489,29 +489,10 @@ def legend(self, *args, **kwargs):
489489
handles = [handle for handle, _
490490
in zip(self._get_legend_handles(handlers), labels)]
491491

492-
# Two arguments. Either:
492+
# Two arguments:
493493
# * user defined handles and labels
494-
# * user defined labels and location (deprecated)
495494
elif len(args) == 2:
496-
if is_string_like(args[1]) or isinstance(args[1], int):
497-
cbook.warn_deprecated('1.4', 'The "loc" positional argument '
498-
'to legend is deprecated. Please use '
499-
'the "loc" keyword instead.')
500-
labels, loc = args
501-
handles = [handle for handle, _
502-
in zip(self._get_legend_handles(handlers), labels)]
503-
kwargs['loc'] = loc
504-
else:
505-
handles, labels = args
506-
507-
# Three arguments. User defined handles, labels and
508-
# location (deprecated).
509-
elif len(args) == 3:
510-
cbook.warn_deprecated('1.4', 'The "loc" positional argument '
511-
'to legend is deprecated. Please '
512-
'use the "loc" keyword instead.')
513-
handles, labels, loc = args
514-
kwargs['loc'] = loc
495+
handles, labels = args
515496

516497
else:
517498
raise TypeError('Invalid arguments to legend.')

0 commit comments

Comments
 (0)