-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: restore default ability to label some minor log ticks. #7419
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
+14
−11
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -853,7 +853,7 @@ def set_locs(self, locs): | |
vmax = math.log(vmax) / math.log(b) | ||
numdec = abs(vmax - vmin) | ||
|
||
if numdec > 3: | ||
if numdec > 1: | ||
# Label only bases | ||
self.sublabel = set((1,)) | ||
else: | ||
|
@@ -1857,10 +1857,10 @@ def tick_values(self, vmin, vmax): | |
|
||
numdec = math.floor(vmax) - math.ceil(vmin) | ||
|
||
if self._subs is None: # autosub | ||
if numdec > 10: | ||
subs = np.array([1.0]) | ||
elif numdec > 6: | ||
if self._subs is None: # autosub for minor ticks | ||
if numdec > 10 or b < 3: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe you should add a comment why no minor ticks should be label when b > 3. |
||
return np.array([]) # no minor ticks | ||
elif numdec > 5 and b >= 6: | ||
subs = np.arange(2.0, b, 2.0) | ||
else: | ||
subs = np.arange(2.0, b) | ||
|
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.
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.
My 2 cents is that we are trying to be too smart here and it has unintended consequences for anyone trying to use this formatter. At most, this sublabel filtering should be disabled by default (and possibly activated internally).
Also, the sublabel should probably (if kept) be private.