Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/whatsnew/v0.12.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ v0.12.2 (Unreleased)
- |Fix| Fixed a regression in v0.12.0 where manually-added labels could have duplicate legend entries (:pr:`3116`).

- |Fix| Fixed a bug in :func:`histplot` with `kde=True` and `log_scale=True` where the curve was not scaled properly (:pr:`3173`).

- |Fix| Fixed a bug in :func:`relplot` where inner axis labels would be shown when axis sharing was disabled (:pr:`3180`).
3 changes: 2 additions & 1 deletion seaborn/relational.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,8 @@ def relplot(
g.map_dataframe(func, **plot_kws)

# Label the axes, using the original variables
g.set(xlabel=variables.get("x"), ylabel=variables.get("y"))
# Pass "" when the variable name is None to overwrite internal variables
g.set_axis_labels(variables.get("x") or "", variables.get("y") or "")

# Show the legend
if legend:
Expand Down
17 changes: 17 additions & 0 deletions tests/test_relational.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,23 @@ def test_relplot_legend(self, long_df):
for line, color in zip(lines, palette):
assert line.get_color() == color

def test_relplot_unshared_axis_labels(self, long_df):

col, row = "a", "b"
g = relplot(
data=long_df, x="x", y="y", col=col, row=row,
facet_kws=dict(sharex=False, sharey=False),
)

for ax in g.axes[-1, :].flat:
assert ax.get_xlabel() == "x"
for ax in g.axes[:-1, :].flat:
assert ax.get_xlabel() == ""
for ax in g.axes[:, 0].flat:
assert ax.get_ylabel() == "y"
for ax in g.axes[:, 1:].flat:
assert ax.get_ylabel() == ""

def test_relplot_data(self, long_df):

g = relplot(
Expand Down