File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -360,7 +360,7 @@ def __init__(
360360 """
361361 # local import only to avoid circularity
362362 from matplotlib .axes import Axes
363- from matplotlib .figure import Figure
363+ from matplotlib .figure import FigureBase
364364
365365 super ().__init__ ()
366366
@@ -434,11 +434,13 @@ def __init__(
434434 self .isaxes = True
435435 self .axes = parent
436436 self .set_figure (parent .figure )
437- elif isinstance (parent , Figure ):
437+ elif isinstance (parent , FigureBase ):
438438 self .isaxes = False
439439 self .set_figure (parent )
440440 else :
441- raise TypeError ("Legend needs either Axes or Figure as parent" )
441+ raise TypeError (
442+ "Legend needs either Axes or FigureBase as parent"
443+ )
442444 self .parent = parent
443445
444446 self ._loc_used_default = loc is None
You can’t perform that action at this time.
0 commit comments