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

Skip to content

Commit 371fcb2

Browse files
Update lib/matplotlib/text.py
Co-authored-by: Tim Hoffmann <[email protected]>
1 parent 20103e7 commit 371fcb2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/matplotlib/text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,8 @@ def get_window_extent(self, renderer=None, dpi=None):
10631063
def get_tightbbox(self, renderer=None):
10641064
# Exclude text at data coordinates outside the valid domain of the axes
10651065
# scales (e.g., negative coordinates with a log scale).
1066-
if (self._outside_axes_domain(*self.get_unitless_position())
1067-
and self.get_transform() == self.axes.transData):
1066+
if (self.axes and self.get_transform() == self.axes.transData # text is a data Artist
1067+
and self._outside_axes_domain(*self.get_unitless_position())):
10681068
return Bbox.null()
10691069
return super().get_tightbbox(renderer)
10701070

0 commit comments

Comments
 (0)