Skip to content

Avoid 1-tick or 0-tick log-scaled axis. #12865

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 28, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Nov 22, 2018

... by switching to AutoLocator when the minor LogLocator would produce
no more than one tick.

The examples below come from #8768, which this fixes.

fig, axs = subplots(2)
axs[0].loglog([.53, .41], [.53, .41])
axs[1].loglog([0.45, 0.46], [0.45, 0.46])

test

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer force-pushed the loglocator-fallbacktoauto branch 2 times, most recently from 26ce31c to c5b9ce4 Compare November 22, 2018 18:54
@timhoffm
Copy link
Member

This looks like the axes have become linear?!?

@anntzer
Copy link
Contributor Author

anntzer commented Nov 22, 2018

They haven't, but on such a small range they'll look linear (#8768 (comment)).

@dstansby
Copy link
Member

+lots for this, but definitely an API change so should get a note!

@anntzer
Copy link
Contributor Author

anntzer commented Nov 23, 2018

done

@jklymak jklymak added this to the v3.0.3 milestone Nov 23, 2018
@jklymak
Copy link
Member

jklymak commented Nov 23, 2018

putting on the backport queue, though not strictly necessary...

@timhoffm
Copy link
Member

Woops. API change note is not there. Did you forget to push?

@jklymak jklymak mentioned this pull request Nov 24, 2018
... by switching to AutoLocator when the minor LogLocator would produce
no more than one tick.
@anntzer anntzer force-pushed the loglocator-fallbacktoauto branch from c5b9ce4 to a918a13 Compare November 28, 2018 10:19
@anntzer
Copy link
Contributor Author

anntzer commented Nov 28, 2018

Indeed, it got lost on the way. Fixed.
Dunno if it's 3.0.3 or 3.1 material, not that I really care.

@timhoffm timhoffm merged commit f093129 into matplotlib:master Nov 28, 2018
@lumberbot-app
Copy link

lumberbot-app bot commented Nov 28, 2018

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout v3.0.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 f0931295930b708cc32a8228430d5cbba991463a
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #12865: Avoid 1-tick or 0-tick log-scaled axis.'
  1. Push to a named branch :
git push YOURFORK v3.0.x:auto-backport-of-pr-12865-on-v3.0.x
  1. Create a PR against branch v3.0.x, I would have named this PR:

"Backport PR #12865 on branch v3.0.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to suggest an improvement.

@anntzer anntzer deleted the loglocator-fallbacktoauto branch November 28, 2018 23:27
@timhoffm
Copy link
Member

@jklymak You labelled as 3.0.3. Any interest in backporting? I would be fine with just leaving it in 3.1 as it's not a regression.

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.

5 participants