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

Skip to content

Commit 190f366

Browse files
committed
Handle prop=None case in AnchoredText.__init__()
The line `propkeys = prop.keys()` will raise an AttributeError if `prop` has its default value of None.
1 parent 59e4ada commit 190f366

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/offsetbox.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,8 @@ def __init__(self, s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs):
10991099
other keyword parameters of AnchoredOffsetbox are also allowed.
11001100
"""
11011101

1102+
if prop is None:
1103+
prop = {}
11021104
propkeys = prop.keys()
11031105
badkwargs = ('ha', 'horizontalalignment', 'va', 'verticalalignment')
11041106
if set(badkwargs) & set(propkeys):

0 commit comments

Comments
 (0)