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

Skip to content

Commit f2cccf8

Browse files
committed
Merge pull request #6005 from tacaswell/fix_empty_strings
FIX: do not short-cut all white-space strings
2 parents d5fb921 + 6ea1d73 commit f2cccf8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/text.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ def draw(self, renderer):
740740
self._renderer = renderer
741741
if not self.get_visible():
742742
return
743-
if self.get_text().strip() == '':
743+
if self.get_text() == '':
744744
return
745745

746746
renderer.open_group('text', self.get_gid())
@@ -949,7 +949,7 @@ def get_window_extent(self, renderer=None, dpi=None):
949949
if dpi is not None:
950950
dpi_orig = self.figure.dpi
951951
self.figure.dpi = dpi
952-
if self.get_text().strip() == '':
952+
if self.get_text() == '':
953953
tx, ty = self._get_xy_display()
954954
return Bbox.from_bounds(tx, ty, 0, 0)
955955

@@ -2211,7 +2211,7 @@ def _update_position_xytext(self, renderer, xy_pixel):
22112211
self.arrow_patch.set_patchA(self._bbox_patch)
22122212
else:
22132213
pad = renderer.points_to_pixels(4)
2214-
if self.get_text().strip() == "":
2214+
if self.get_text() == "":
22152215
self.arrow_patch.set_patchA(None)
22162216
return
22172217

0 commit comments

Comments
 (0)