Skip to content

[ENH]: Support Axes.set_xticks(**kwargs) to set tick params without setting fixed ticks #28456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anntzer opened this issue Jun 25, 2024 · 3 comments

Comments

@anntzer
Copy link
Contributor

anntzer commented Jun 25, 2024

Problem

To define and rotate custom tick labels at the same time, one can use e.g. ax.set_xticks(ticks, labels, rotation=45), and pass whatever additional Text properties one wants, e.g rotation_mode="anchor". On the other hand, if one wants to just rotate the default tick labels or apply other properties (which is likely the more common case), one has to use ax.tick_params("x", rotation=45)... and some properties are unsupported, such as rotation_mode.

Proposed solution

It would seem reasonable to allow e.g. ax.set_xticks(rotation=45, rotation_mode="anchor"), i.e. calling set_xticks without actually passing ticks and labels, and interpret that as "leave the tick locator & formatter as is, but apply the given properties".

@tacaswell
Copy link
Member

Would it be better to add the missing parameters to ax.tick_params ?

@story645
Copy link
Member

xref #20644

@anntzer
Copy link
Contributor Author

anntzer commented Jun 25, 2024

Actually this is a dupe of #23272, let's move the discussion there.

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

No branches or pull requests

3 participants