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

Skip to content

Commit 7293734

Browse files
committed
Simplify and fix expressions
1 parent 45cdee2 commit 7293734

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def _get_layout(self, renderer):
438438
elif valign == 'baseline':
439439
offsety = (ymin + height) - baseline
440440
elif valign == 'center_baseline':
441-
offsety = (ymin + (height + (height - baseline)) / 2.0)
441+
offsety = ymin + height - baseline / 2.0
442442
else:
443443
offsety = ymin
444444
else:
@@ -459,7 +459,7 @@ def _get_layout(self, renderer):
459459
elif valign == 'baseline':
460460
offsety = ymax1 - baseline
461461
elif valign == 'center_baseline':
462-
offsety = (ymin1 + ymax1) / 2.0
462+
offsety = (ymin1 + ymax1 - baseline) / 2.0
463463
else:
464464
offsety = ymin1
465465

0 commit comments

Comments
 (0)