Remove pyplot monkey-patch and preserve default tick locations for single-subplot figures. - #26
Open
Montana wants to merge 1 commit into
Open
Remove pyplot monkey-patch and preserve default tick locations for single-subplot figures.#26Montana wants to merge 1 commit into
pyplot monkey-patch and preserve default tick locations for single-subplot figures.#26Montana wants to merge 1 commit into
Conversation
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.
Hello all,
This update removes the old
pyplot monkey-patchthat automatically enabled and recolored minor ticks when figures were created. That patch was responsible for inconsistent tick placement and duplicated axis ticks in single-subplot figures, as reported in issue #13.The new implementation simplifies the style application process by relying solely on
rcParamsfor controlling minor tick visibility (xtick.minor.visibleandytick.minor.visible) without modifyingAxesobjects or altering Matplotlib’s default locators and formatters. As a result, the style remains visually identical while restoring consistent and predictable tick behavior across all subplot configurations. A new regression test (tests/test_ticks_single_subplot.py) has been added to ensure that enablingqbstylesno longer changes tick locations or places ticks outside of defined limits. This fix fully resolves the “automatic axis ticks” inconsistency and maintains backward compatibility for users callingmpl_style().Michael.