You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ENH]: Make rotation_mode="xtick" the default for ticks #29926
#28968 introduced new rotation modes "xtick"/"ytick". We've employed them to all our examples, as this rotation setting is superior compared to fiddling with horizontal/verticalalignment. It's "how tick rotation should be".
Proposed solution
Make these the default rotation modes for tick labels.
Technically, this is a breaking change, but I argue it's the better default and the breakage is minor:
If users did not specify alignment, it's changed from "centered" alignment to the "pointing to tick" aligment.
If users have cared to do the "pointing" to tick alignment manually (which is what we were teaching in examples before), their plot will stay the same.
If users have chosen other alignment, they'll need to adapt.
This is a tradeoff between making a reasonable default so that in the future rotated ticks are "just right" and people don't have to do rotation_mode="xtick" explicitly all the time and breaking explicit alignment compatibility for a few rare edge cases.
would ignore the ha if the rotation mode is set to xtick by default.
What we could do: For rotation_mode="xtick" only take the computed horizontalalignment if rotation!=0. This means for unrotated text, a user-set horizontalalignment value is kept.
Likely the "clean" approach would be to track whether the alignment was set by the user. If so, respect that, otherwise let rotation_mode adjust the alignment.
Activity
kc9323 commentedon May 1, 2025
Hi @timhoffm , may I work on this issue?
timhoffm commentedon May 2, 2025
@kyracho you are welcome! Two slight caveats:
timhoffm commentedon Jun 24, 2025
Actually, it's slightly more complicated.
would ignore the
haif the rotation mode is set toxtickby default.What we could do: For
rotation_mode="xtick"only take the computed horizontalalignment ifrotation!=0. This means for unrotated text, a user-set horizontalalignment value is kept.timhoffm commentedon Mar 2, 2026
Likely the "clean" approach would be to track whether the alignment was set by the user. If so, respect that, otherwise let
rotation_modeadjust the alignment.