Skip to content

Remove pyplot monkey-patch and preserve default tick locations for single-subplot figures. - #26

Open
Montana wants to merge 1 commit into
mckinsey:masterfrom
Montana:patch-1
Open

Remove pyplot monkey-patch and preserve default tick locations for single-subplot figures.#26
Montana wants to merge 1 commit into
mckinsey:masterfrom
Montana:patch-1

Conversation

@Montana

@Montana Montana commented Oct 24, 2025

Copy link
Copy Markdown

Hello all,

This update removes the old pyplot monkey-patch that 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 rcParams for controlling minor tick visibility (xtick.minor.visible and ytick.minor.visible) without modifying Axes objects 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 enabling qbstyles no 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 calling mpl_style().

Michael.

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.

1 participant