Fix shifted ylabels (Issue #1571) #1589

Merged
merged 1 commit into from Jan 16, 2013
+5 −3
View
8 lib/matplotlib/axis.py
@@ -1887,10 +1887,12 @@ def set_label_position(self, position):
ACCEPTS: [ 'left' | 'right' ]
"""
assert position == 'left' or position == 'right'
- if position == 'right':
- self.label.set_horizontalalignment('left')
+ self.label.set_rotation_mode('anchor')
+ self.label.set_horizontalalignment('center')
+ if position == 'left':
+ self.label.set_verticalalignment('bottom')
else:
- self.label.set_horizontalalignment('right')
+ self.label.set_verticalalignment('top')
self.label_position = position
def _update_label_position(self, bboxes, bboxes2):