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

Skip to content

Commit 9290f57

Browse files
committed
Merge pull request #2582 from leejjoon/fix_annotation_bbox_default
fix initialization of AnnotationBbox
2 parents c424d17 + 234781a commit 9290f57

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)