Tick label rotation via `set_tick_params` #6829

Merged
merged 3 commits into from Jul 27, 2016

Conversation

Projects
None yet
3 participants
Contributor

bcongdon commented Jul 25, 2016

Addresses #6795.

Implemented @tacaswell's suggestion so that commands such as ax.xaxis.set_tick_params(which='both', rotation=90) are now possible.

Added related test and whats_new entry.

mdboom added the needs_review label Jul 25, 2016

@tacaswell tacaswell commented on an outdated diff Jul 25, 2016

lib/matplotlib/axis.py
@@ -73,6 +73,7 @@ def __init__(self, axes, loc, label,
pad=None,
labelsize=None,
labelcolor=None,
+ labelrotation=0,
@tacaswell

tacaswell Jul 25, 2016

Owner

Please put last so to preserve API

tacaswell added this to the 2.1 (next point release) milestone Jul 25, 2016

Owner

tacaswell commented Jul 25, 2016

Can you add a test? I don't think this needs an image test, just verify that the rotation value ends up correctly on the tick labels.

@bcongdon bcongdon Added whats_new entry for axes tick rotation via set_tick_params
a755218
Contributor

bcongdon commented Jul 25, 2016

I added this test to do assertion of label rotation. Is that sufficient?

Owner

tacaswell commented Jul 25, 2016

👍 Looks great. Just waiting on CI.

Owner

tacaswell commented Jul 26, 2016

Sorry, one last thing, can you also update the docstrings in set_params in axes/_base.py ?

@bcongdon bcongdon Added labelrotation to tick_params docstrings
edbe0cc
Contributor

bcongdon commented Jul 26, 2016

Yup, done.

@tacaswell tacaswell merged commit d308eec into matplotlib:master Jul 27, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.03%) to 70.373%
Details

tacaswell removed the needs_review label Jul 27, 2016

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