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

Skip to content

Commit 4610641

Browse files
committed
another attempt to fix TextWithDash
svn path=/trunk/matplotlib/; revision=5701
1 parent e49c689 commit 4610641

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2008-06-30 Another attempt to fix TextWithDash - DSD
2+
13
2008-06-30 Removed Qt4 NavigationToolbar2.destroy -- it appears to
24
have been unnecessary and caused a bug reported by P.
35
Raybaut - DSD

lib/matplotlib/text.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,12 @@ def draw(self, renderer):
298298

299299
bbox, info = self._get_layout(renderer)
300300
trans = self.get_transform()
301-
posx, posy = self.get_position()
301+
302+
# don't use self.get_position here, which refers to text position
303+
# in Text, and dash position in TextWithDash:
304+
posx = float(self.convert_xunits(self._x))
305+
posy = float(self.convert_yunits(self._y))
306+
302307
posx, posy = trans.transform_point((posx, posy))
303308
canvasw, canvash = renderer.get_canvas_width_height()
304309

0 commit comments

Comments
 (0)