X Tutup
Skip to content

Update two_scales.py example.#7455

Merged
tacaswell merged 1 commit intomatplotlib:masterfrom
anntzer:update-example-two-scales
Nov 15, 2016
Merged

Update two_scales.py example.#7455
tacaswell merged 1 commit intomatplotlib:masterfrom
anntzer:update-example-two-scales

Conversation

@anntzer
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

X Tutup