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

Skip to content

Commit 2e4d4bd

Browse files
committed
Merged revisions 6658 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint ........ r6658 | leejjoon | 2008-12-18 03:55:50 -0500 (Thu, 18 Dec 2008) | 1 line fix dpi-dependent behavior of text bbox & annotate arrow ........ svn path=/trunk/matplotlib/; revision=6659
1 parent 3b15ce4 commit 2e4d4bd

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2008-12-17 fix dpi-dependent behavior of text bbox and arrow in annotate
2+
-JJL
3+
14
2008-12-17 Add group id support in artist. Two examples which
25
demostrate svg filter are added. -JJL
36

lib/matplotlib/text.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ def get_bbox_patch(self):
367367

368368

369369
def update_bbox_position_size(self, renderer):
370-
""" Update the location and the size of the bbox. This method
370+
"""
371+
Update the location and the size of the bbox. This method
371372
should be used when the position and size of the bbox needs to
372373
be updated before actually drawing the bbox.
373374
"""
@@ -395,8 +396,8 @@ def update_bbox_position_size(self, renderer):
395396
tr = mtransforms.Affine2D().rotate(theta)
396397
tr = tr.translate(posx+x_box, posy+y_box)
397398
self._bbox_patch.set_transform(tr)
398-
fontsize = renderer.points_to_pixels(self.get_size())
399-
self._bbox_patch.set_mutation_scale(fontsize)
399+
fontsize_in_pixel = renderer.points_to_pixels(self.get_size())
400+
self._bbox_patch.set_mutation_scale(fontsize_in_pixel)
400401
#self._bbox_patch.draw(renderer)
401402

402403
else:
@@ -434,7 +435,8 @@ def _draw_bbox(self, renderer, posx, posy):
434435
tr = mtransforms.Affine2D().rotate(theta)
435436
tr = tr.translate(posx+x_box, posy+y_box)
436437
self._bbox_patch.set_transform(tr)
437-
self._bbox_patch.set_mutation_scale(self.get_size())
438+
fontsize_in_pixel = renderer.points_to_pixels(self.get_size())
439+
self._bbox_patch.set_mutation_scale(fontsize_in_pixel)
438440
self._bbox_patch.draw(renderer)
439441

440442

@@ -1563,6 +1565,7 @@ def update_positions(self, renderer):
15631565

15641566
self.arrow_patch.set_positions((ox0, oy0), (ox1,oy1))
15651567
mutation_scale = d.pop("mutation_scale", self.get_size())
1568+
mutation_scale = renderer.points_to_pixels(mutation_scale)
15661569
self.arrow_patch.set_mutation_scale(mutation_scale)
15671570

15681571
if self._bbox_patch:

0 commit comments

Comments
 (0)