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

Skip to content

Commit 75129c9

Browse files
committed
Omit mtext instance for pre-layouted, multiple lines.
1 parent e2f8591 commit 75129c9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2014-05-16 Fixed the positioning of multi-line text in the PGF backend.
2+
13
2014-05-14 Added Axes.add_image() as the standard way to add AxesImage
24
instances to Axes. This improves the consistency with
35
add_artist(), add_collection(), add_container(), add_line(),

lib/matplotlib/text.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ def draw(self, renderer):
564564
if not np.isfinite(x) or not np.isfinite(y):
565565
continue
566566

567+
mtext = self if len(info) == 1 else None
567568
x = x + posx
568569
y = y + posy
569570
if renderer.flipy():
@@ -577,11 +578,11 @@ def draw(self, renderer):
577578

578579
if rcParams['text.usetex']:
579580
renderer.draw_tex(gc, x, y, clean_line,
580-
self._fontproperties, angle, mtext=self)
581+
self._fontproperties, angle, mtext=mtext)
581582
else:
582583
renderer.draw_text(gc, x, y, clean_line,
583584
self._fontproperties, angle,
584-
ismath=ismath, mtext=self)
585+
ismath=ismath, mtext=mtext)
585586

586587
gc.restore()
587588
renderer.close_group('text')

0 commit comments

Comments
 (0)