ENH: LogLocator can auto-select number of ticks based on axis#7126
Merged
Conversation
Closes matplotlib#6549 and matplotlib#7001. It doesn't actually address all cases noted in matplotlib#6549, but I think this is as far as we are prepared to go any time soon.
NelleV
approved these changes
Sep 19, 2016
| def tick_values(self, vmin, vmax): | ||
| if self.numticks == 'auto': | ||
| if self.axis is not None: | ||
| numticks = max(min(self.axis.get_tick_space(), 9), 2) |
Member
There was a problem hiding this comment.
I understand the minimum of 2, but 9 seems a bit of a random number. Why was this chosen?
Member
Author
There was a problem hiding this comment.
You are right, it is pretty random. It is the default max we chose for the MaxNLocator auto algorithm, so I used it here as well. The rationale in both cases is that plots just don't look good with a huge number of major ticks; so 9 is random, but it "seems reasonable" as a limit. Nothing prevents a user from specifying a larger number instead of using the auto algorithm.
Member
|
Thanks for the patch. This looks good to me 👍 |
Member
efiring
added a commit
to efiring/matplotlib
that referenced
this pull request
Sep 21, 2016
This is a follow-up to matplotlib#7126, 6741ddf.
This was referenced Sep 21, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6549 and #7001. It doesn't actually address all cases
noted in #6549, but I think this is as far as we are prepared to go
any time soon.