Skip to content

Fix Axis scale on twinned Axes. - #18393

Merged
dopplershift merged 1 commit into
matplotlib:masterfrom
QuLogic:twin-scale
Sep 11, 2020
Merged

dopplershift merged 1 commit into
matplotlib:masterfrom
QuLogic:twin-scale

Conversation

@QuLogic

@QuLogic QuLogic commented Sep 2, 2020 •

Copy link
Copy Markdown
Member

PR Summary

If Axes._sharex is not set, then the subsequent Axes.cla will change the Axis scale to linear. If Axes._sharex is set, then Axes.cla will call Axes.sharex just as was done here, but without resetting scale to linear.

Fixes #18385.

This won't pass yet, as it turns out that twinned Axes double-draw the frame, though if we really need to apply this quickly, I can increase the tolerance.

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • [n/a] New features are documented, with examples if plot related.
  • [n/a] Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and pydocstyle<4 and run flake8 --docstring-convention=all).
  • [n/a] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@QuLogic QuLogic added this to the v3.3.2 milestone Sep 2, 2020
If `Axes._sharex` is not set, then the subsequent `Axes.cla` will change
the Axis scale to linear. If `Axes._sharex` is set, then `Axes.cla` will
call `Axes.sharex` just as was done here, but without resetting scale to
linear.
@QuLogic
QuLogic marked this pull request as ready for review September 2, 2020 07:21
@QuLogic

QuLogic commented Sep 2, 2020

Copy link
Copy Markdown
Member Author

This won't pass yet, as it turns out that twinned Axes double-draw the frame, though if we really need to apply this quickly, I can increase the tolerance.

I changed my mind as that's a bit more work that we maybe don't want to backport, so I tweaked the test a bit to pass for now.

@dopplershift
dopplershift merged commit 3e13f81 into matplotlib:master Sep 11, 2020
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 11, 2020
@QuLogic
QuLogic deleted the twin-scale branch September 11, 2020 23:42
dopplershift added a commit that referenced this pull request Sep 11, 2020
…393-on-v3.3.x

Backport PR #18393 on branch v3.3.x (Fix Axis scale on twinned Axes.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

twinx not respecting log-scale

3 participants