Skip to content

Update two_scales.py example. #7455

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

Merged
merged 1 commit into from
Nov 15, 2016

Conversation

anntzer
Copy link
Contributor

@anntzer 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.

@anntzer anntzer force-pushed the update-example-two-scales branch from 291911f to e6cf398 Compare November 14, 2016 03:07
for tl in ax1.get_yticklabels():
tl.set_color('b')

ax1.set_ylabel('exp', color='r')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be 'b' to match the ticks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, fixed.

@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Nov 14, 2016
@anntzer anntzer force-pushed the update-example-two-scales branch from e6cf398 to 5662640 Compare November 14, 2016 06:46
for tl in ax1.get_yticklabels():
tl.set_color('b')

ax1.tick_params('y', color='b', labelcolor='b')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.
@anntzer anntzer force-pushed the update-example-two-scales branch from 5662640 to 1e3492f Compare November 14, 2016 22:39
@NelleV NelleV changed the title Update two_scales.py example. [MRG+1] Update two_scales.py example. Nov 14, 2016
@NelleV
Copy link
Member

NelleV commented Nov 14, 2016

Thanks @anntzer for the improvements!

@tacaswell tacaswell merged commit 048a7b4 into matplotlib:master Nov 15, 2016
tacaswell added a commit that referenced this pull request Nov 15, 2016
@tacaswell
Copy link
Member

Thanks!

Backported to v2.x as eace7a6

@anntzer anntzer deleted the update-example-two-scales branch November 15, 2016 03:52
@QuLogic QuLogic changed the title [MRG+1] Update two_scales.py example. Update two_scales.py example. Nov 15, 2016
@QuLogic QuLogic modified the milestones: 2.0.1 (next bug fix release), 2.0 (style change major release) Dec 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants