-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Update two_scales.py example. #7455
Conversation
291911f
to
e6cf398
Compare
for tl in ax1.get_yticklabels(): | ||
tl.set_color('b') | ||
|
||
ax1.set_ylabel('exp', color='r') |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, fixed.
e6cf398
to
5662640
Compare
for tl in ax1.get_yticklabels(): | ||
tl.set_color('b') | ||
|
||
ax1.tick_params('y', color='b', labelcolor='b') |
There was a problem hiding this comment.
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')
?
There was a problem hiding this comment.
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.
5662640
to
1e3492f
Compare
Thanks @anntzer for the improvements! |
DOC: Update two_scales.py example.
Thanks! Backported to v2.x as eace7a6 |
The docstring refers to the non-existing
axes.py
, and mentions havingto 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.