From 5f69eeb564db04fae298283dbc3f8a6cfd51ba52 Mon Sep 17 00:00:00 2001 From: Michael Waskom Date: Wed, 5 May 2021 20:09:12 -0400 Subject: [PATCH] Set heatmap yticklabel alignment while rotating (#2574) * Set heatmap yticklabel alignment while rotating Closes #2484 * Update release notes [skip ci] (cherry picked from commit 430c1bf1fcc690f0431e6fc87b481b7b43776594) --- doc/releases/v0.12.0.txt | 2 ++ seaborn/matrix.py | 1 + 2 files changed, 3 insertions(+) diff --git a/doc/releases/v0.12.0.txt b/doc/releases/v0.12.0.txt index fec3f18182..4bc129e59d 100644 --- a/doc/releases/v0.12.0.txt +++ b/doc/releases/v0.12.0.txt @@ -43,6 +43,8 @@ v0.12.0 (Unreleased) - |Fix| In :func:`displot`, fixed a bug where `common_norm` was ignored when `kind="hist"` and faceting was used without assigning `hue` (:pr:`2468`). +- |Fix| In :func:`heatmap`, fixed a bug where vertically-rotated y-axis tick labels would be misaligned with their rows (:pr:`2574`). + - |Defaults| In :func:`displot`, the default alpha value now adjusts to a provided `multiple` parameter even when `hue` is not assigned (:pr:`2462`). - |Docs| Improved the API documentation for theme-related functions (:pr:`2573`). diff --git a/seaborn/matrix.py b/seaborn/matrix.py index d8b518b9d9..68f92c3380 100644 --- a/seaborn/matrix.py +++ b/seaborn/matrix.py @@ -325,6 +325,7 @@ def plot(self, ax, cax, kws): ax.set(xticks=xticks, yticks=yticks) xtl = ax.set_xticklabels(xticklabels) ytl = ax.set_yticklabels(yticklabels, rotation="vertical") + plt.setp(ytl, va="center") # GH2484 # Possibly rotate them if they overlap if hasattr(ax.figure.canvas, "get_renderer"):