mwaskom / seaborn

Statistical data visualization in Python
https://seaborn.pydata.org
BSD 3-Clause "New" or "Revised" License
12.39k stars 1.91k forks source link

Axis / tick labels (control) on internal subplot axes need improvement #2980

Open mwaskom opened 2 years ago

mwaskom commented 2 years ago

When axes are shared, "internal" axes have axis and tick labels hidden. This is a good default, but might not always be what you want. It should be configurable somehow (perhaps in Plot.layout?)

Additionally, the default is not idea with a "wrapped" figure where the axis is "internal" but all of the axes external to it have been removed. e.g.

(
    so.Plot(mpg, x="mpg")
    .pair(y=["displacement", "weight", "acceleration"], wrap=2)
    .add(so.Dots())
)

image

The tick labels are hidden (matplotlib has actually removed them due to axis sharing logic) but the axis label is visible (I actually don't understand why that is; I didn't think we had logic for that but maybe we do). Probably we want either, or both, or tick labels but not axis label, but the current situation is the worst of all possible worlds.

Note that this specific situation also has some complex interactions with tight_layout / constrained_layout in terms of how much space is left between the other axes; it might be necessary to remove whichever ends up here "from the layout". Kind of a mess all around. Punting to after v0.12.0.

MaozGelbart commented 1 year ago

The tick labels are hidden (matplotlib has actually removed them due to axis sharing logic) but the axis label is visible (I actually don't understand why that is; I didn't think we had logic for that but maybe we do).

This happens here: https://github.com/mwaskom/seaborn/blob/22cdfb0c93f8ec78492d87edb810f10cb7f57a31/seaborn/_core/plot.py#L1038