Skip to content

Fix tick labels disappearing with FacetGrid.set_<x|y>ticklabels#3926

Open
JustinVanHeek wants to merge 3 commits into
mwaskom:masterfrom
JustinVanHeek:fix-facetgrid-xticklabels
Open

Fix tick labels disappearing with FacetGrid.set_<x|y>ticklabels#3926
JustinVanHeek wants to merge 3 commits into
mwaskom:masterfrom
JustinVanHeek:fix-facetgrid-xticklabels

Conversation

@JustinVanHeek

@JustinVanHeek JustinVanHeek commented Apr 5, 2026

Copy link
Copy Markdown

Resolves #3341

When sharex or sharey is true, only the bottom or left axes get the tick labels. This causes issues when set_xticklabels or set_yticklabels is called without labels (a common case is using the rotation argument to rotate the current labels) and can result in those axes losing their tick labels.

This PR resolves this issue by getting the current tick labels before any operations occur. Edit: Upon further investigation for cases with share<x|y>=<"col"|"row"> and the discovery of a related bug when set_xticklabels has the step argument, the solution has been updated.

This PR resolves this issue by ensuring only the relevant axes are modified. It also ensures the correct number of ticks are selected by slicing the original sequence of ticks when set_xticklabels has the step argument.

Related: #1716 #1598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: seaborn.axisgrid.FacetGrid.set_xticklabels(rotation=70) makes x-ticks disappear

1 participant