Improve tick density near zero for SymmetricalLogLocator#31381
Closed
saitejaponnam12 wants to merge 3 commits intomatplotlib:mainfrom
Closed
Improve tick density near zero for SymmetricalLogLocator#31381saitejaponnam12 wants to merge 3 commits intomatplotlib:mainfrom
saitejaponnam12 wants to merge 3 commits intomatplotlib:mainfrom
Conversation
…ator - Handle None value for numticks parameter explicitly - Reject invalid values (numticks <= 0) - Strictly respect numticks budget: min(5, numticks) only when positive - Constrain linspace bounds to linear region: max(vmin, -linthresh) to min(vmax, linthresh) - Add safety guard: only create linear ticks if linear_vmax > linear_vmin - Prevents exceeding set tick count in all edge cases Addresses code review feedback about budget respect.
- Split long lines to <= 88 characters - Split comment across lines - Use hanging indents for long function calls - Remove trailing whitespace - Follow Matplotlib code style conventions
Contributor
|
Please share some before/after screenshots demonstrating the issue and your change. I think generally we would want a change like this to be opened as an issue first, so that we can discuss if it's needed or not |
Contributor
|
Closing this because you have not yet completed your first PR. Please see that through to completion before opening a second: #31361 (comment) For the ticks change you are describing here, please open it as an issue for discussion instead, with more details of why the change is needed. |
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.
PR summary
Improve tick density near zero for SymmetricalLogLocator.
When using the symlog scale, the linear region around zero often produces too few ticks, making plots harder to interpret.
This change adds a small number of evenly spaced ticks in the linear region and merges them with the logarithmic ticks while preserving ordering and uniqueness.
Example:
This improves readability near zero without affecting logarithmic regions.
AI Disclosure
AI assistance was used to explore approaches and refine structure. The final implementation and testing were manually verified.
PR checklist