Skip to content

Commit 7e4d26a

Browse files
committed
Fix vertical tick alignment
1 parent 1c27984 commit 7e4d26a

File tree

318 files changed

+14949
-14981
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

318 files changed

+14949
-14981
lines changed

lib/matplotlib/axes/_base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ def get_yaxis_text1_transform(self, pad_points):
773773
return (self.get_yaxis_transform(which='tick1') +
774774
mtransforms.ScaledTranslation(-1 * pad_points / 72.0, 0,
775775
self.figure.dpi_scale_trans),
776-
"center", "right")
776+
"center_baseline", "right")
777777

778778
def get_yaxis_text2_transform(self, pad_points):
779779
"""
@@ -799,7 +799,7 @@ def get_yaxis_text2_transform(self, pad_points):
799799
return (self.get_yaxis_transform(which='tick2') +
800800
mtransforms.ScaledTranslation(pad_points / 72.0, 0,
801801
self.figure.dpi_scale_trans),
802-
"center", "left")
802+
"center_baseline", "left")
803803

804804
def _update_transScale(self):
805805
self.transScale.set(

lib/matplotlib/backends/backend_pgf.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,10 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
653653

654654
f = 1.0 / self.figure.dpi
655655
text_args = []
656-
if mtext and (angle == 0 or mtext.get_rotation_mode() == "anchor"):
656+
if mtext and (
657+
(angle == 0 or
658+
mtext.get_rotation_mode() == "anchor") and
659+
mtext.get_va() != "center_baseline"):
657660
# if text anchoring can be supported, get the original coordinates
658661
# and add alignment information
659662
x, y = mtext.get_transform().transform_point(mtext.get_position())
Binary file not shown.

lib/matplotlib/tests/baseline_images/test_axes/axhspan_epoch.svg

+106-106
Loading
Binary file not shown.

lib/matplotlib/tests/baseline_images/test_axes/axvspan_epoch.svg

+106-106
Loading
Binary file not shown.
Loading

lib/matplotlib/tests/baseline_images/test_axes/boxplot.svg

+65-65
Loading
Binary file not shown.
Loading

0 commit comments

Comments
 (0)