Update two_scales.py example. #7455

Merged
merged 1 commit into from Nov 15, 2016

Conversation

Projects
None yet
5 participants
Contributor

anntzer commented Nov 14, 2016

The docstring refers to the non-existing axes.py, and mentions having
to remove the rectangular frame, which is no longer the case. I also
suspect that it was written when twiny didn't exist yet...

Use tick_params instead of iterating over the ticks.

examples/api/two_scales.py
-for tl in ax1.get_yticklabels():
- tl.set_color('b')
-
+ax1.set_ylabel('exp', color='r')
@tacaswell

tacaswell Nov 14, 2016

Owner

should this be 'b' to match the ticks?

@anntzer

anntzer Nov 14, 2016

Contributor

oops, fixed.

examples/api/two_scales.py
-for tl in ax1.get_yticklabels():
- tl.set_color('b')
-
+ax1.tick_params('y', color='b', labelcolor='b')
@Kojoley

Kojoley Nov 14, 2016

Member

Could not this be tick_params('y', colors='b')?

@anntzer

anntzer Nov 14, 2016

Contributor

I didn't know that kwarg... fixed.

@anntzer anntzer Update two_scales.py example.
The docstring refers to the non-existing `axes.py`, and mentions having
to remove the rectangular frame, which is no longer the case.  I also
suspect that it was written when `twiny` didn't exist yet...

Use `tick_params` instead of iterating over the ticks.
1e3492f
@NelleV

NelleV approved these changes Nov 14, 2016

NelleV changed the title from Update two_scales.py example. to [MRG+1] Update two_scales.py example. Nov 14, 2016

Contributor

NelleV commented Nov 14, 2016

Thanks @anntzer for the improvements!

@tacaswell tacaswell merged commit 048a7b4 into matplotlib:master Nov 15, 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 remained the same at 61.842%
Details

@tacaswell tacaswell added a commit that referenced this pull request Nov 15, 2016

@tacaswell tacaswell Merge pull request #7455 from anntzer/update-example-two-scales
DOC: Update two_scales.py example.
eace7a6
Owner

tacaswell commented Nov 15, 2016

Thanks!

Backported to v2.x as eace7a6

anntzer deleted the anntzer:update-example-two-scales branch Nov 15, 2016

QuLogic changed the title from [MRG+1] Update two_scales.py example. to Update two_scales.py example. Nov 15, 2016

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