Skip to content
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

axes.get_xticklabels() doesn't return all tick labels. #1715

Closed
pzakielarz opened this issue Jan 29, 2013 · 1 comment · Fixed by #2628
Closed

axes.get_xticklabels() doesn't return all tick labels. #1715

pzakielarz opened this issue Jan 29, 2013 · 1 comment · Fixed by #2628
Assignees

Comments

@pzakielarz
Copy link

There is no way to select both major and minor tick labels at the same time. For example
(if ax is a matplolib.axes),

for label in ax.get_xticklabels():
    label.set_rotation(45)

only adjusts the major ticks, and

for label in ax.get_xticklabels(minor=True):
    label.set_rotation(45)

only adjusts the minor ticks.

It would be convenient if axis.get_ticklabels() took an argument of the form which='both', instead of minor=True\False, which would allow the corresponding functionality to be implemented in ax.get_xticklabels().

@tacaswell
Copy link
Member

You can get this without modifying the API

import itertools

for label in itertools.chain(*[ax.get_xticklabels(minor=minor) for minor in [True, False]]):
    label.set_rotation(45)

@ghost ghost assigned tacaswell Nov 29, 2013
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Nov 30, 2013
and Axes.get_yticklabels to match the pattern in other tick-related
functions

Closes matplotlib#1715
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Dec 3, 2013
and Axes.get_yticklabels to match the pattern in other tick-related
functions

Closes matplotlib#1715
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Dec 12, 2013
and Axes.get_yticklabels to match the pattern in other tick-related
functions

Closes matplotlib#1715
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Jan 5, 2014
and Axes.get_yticklabels to match the pattern in other tick-related
functions

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

Successfully merging a pull request may close this issue.

2 participants