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

Skip to content

Commit d772043

Browse files
Ignore empty text for tightbbox
1 parent eee6586 commit d772043

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/matplotlib/text.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,8 @@ def get_window_extent(self, renderer=None, dpi=None):
10421042
return bbox
10431043

10441044
def get_tightbbox(self, renderer=None):
1045+
if not self.get_visible() or self.get_text() == "":
1046+
return Bbox.null()
10451047
# Exclude text at data coordinates outside the valid domain of the axes
10461048
# scales (e.g., negative coordinates with a log scale).
10471049
if (self.axes

0 commit comments

Comments
 (0)