Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb2a80a7

Browse files
committed
Fix shifted ylabels (#1571)
Force 'anchor' rotation mode when setting the label position,and use the appropriate alignment for the Y-label position.
1 parenta0d82ac commitb2a80a7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎lib/matplotlib/axis.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,10 +1887,12 @@ def set_label_position(self, position):
18871887
ACCEPTS: [ 'left' | 'right' ]
18881888
"""
18891889
assertposition=='left'orposition=='right'
1890-
ifposition=='right':
1891-
self.label.set_horizontalalignment('left')
1890+
self.label.set_rotation_mode('anchor')
1891+
self.label.set_horizontalalignment('center')
1892+
ifposition=='left':
1893+
self.label.set_verticalalignment('bottom')
18921894
else:
1893-
self.label.set_horizontalalignment('right')
1895+
self.label.set_verticalalignment('top')
18941896
self.label_position=position
18951897

18961898
def_update_label_position(self,bboxes,bboxes2):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp