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

Skip to content

Commit 112412e

Browse files
committed
Fix #1885: Text clipping should always set the patch to the axes, regardless of the state of the clip_on kwarg, so that clip_on can be toggled after the fact
1 parent 1d6abc1 commit 112412e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/matplotlib/axes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3394,6 +3394,7 @@ def text(self, x, y, s, fontdict=None,
33943394
'verticalalignment' : 'baseline',
33953395
'horizontalalignment' : 'left',
33963396
'transform' : self.transData,
3397+
'clip_on' : False
33973398
}
33983399

33993400
# At some point if we feel confident that TextWithDash
@@ -3418,9 +3419,7 @@ def text(self, x, y, s, fontdict=None,
34183419
self.texts.append(t)
34193420
t._remove_method = lambda h: self.texts.remove(h)
34203421

3421-
3422-
#if t.get_clip_on(): t.set_clip_box(self.bbox)
3423-
if 'clip_on' in kwargs: t.set_clip_box(self.bbox)
3422+
t.set_clip_path(self.patch)
34243423
return t
34253424

34263425
@docstring.dedent_interpd

0 commit comments

Comments
 (0)