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

Skip to content

Commit 234781a

Browse files
committed
fix initialization of AnnotationBbox where None values of xybox and boxcoords parameters are not correctly handled.
1 parent 84e0063 commit 234781a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/matplotlib/offsetbox.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,9 +1266,15 @@ def __init__(self, offsetbox, xy,
12661266

12671267
self.set_fontsize(fontsize)
12681268

1269-
self.xybox = xybox
1269+
if xybox is None:
1270+
self.xybox = xy
1271+
else:
1272+
self.xybox = xybox
12701273

1271-
self.boxcoords = boxcoords
1274+
if boxcoords is None:
1275+
self.boxcoords = xycoords
1276+
else:
1277+
self.boxcoords = boxcoords
12721278

12731279
if arrowprops is not None:
12741280
self._arrow_relpos = self.arrowprops.pop("relpos", (0.5, 0.5))

0 commit comments

Comments
 (0)