Skip to content

Fix tick visibility leaking from styles in alternative axes#721

Merged
cvanelteren merged 1 commit into
mainfrom
fix-dark-style-tick-leak
May 12, 2026
Merged

Fix tick visibility leaking from styles in alternative axes#721
cvanelteren merged 1 commit into
mainfrom
fix-dark-style-tick-leak

Conversation

@cvanelteren
Copy link
Copy Markdown
Collaborator

When applying custom styles like dark_background, matplotlib's styling dictionaries often include explicit boolean flags for tick visibility on all sides (e.g. left, right, top, bottom). Previously, UltraPlot queried these style settings using _get_tickline_props and inadvertently reapplied them to the axes, completely overriding UltraPlot's internal locators. This caused bugs such as the left axis displaying right ticks and the right axis displaying left ticks when a style was active. By aggressively popping visibility keys out of the retrieved styling dictionary, we ensure that themes strictly govern visual appearances (color, width, padding) without hijacking the structural tick visibility correctly managed by the format methods.

When applying custom styles like dark_background, matplotlib's styling dictionaries often include explicit boolean flags for tick visibility on all sides (e.g. left, right, top, bottom). Previously, UltraPlot queried these style settings using _get_tickline_props and inadvertently reapplied them to the axes, completely overriding UltraPlot's internal locators. This caused bugs such as the left axis displaying right ticks and the right axis displaying left ticks when a style was active. By aggressively popping visibility keys out of the retrieved styling dictionary, we ensure that themes strictly govern visual appearances (color, width, padding) without hijacking the structural tick visibility correctly managed by the format methods.
@cvanelteren cvanelteren merged commit fbf413c into main May 12, 2026
2 of 3 checks passed
@cvanelteren cvanelteren deleted the fix-dark-style-tick-leak branch May 12, 2026 08:32
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@munechika-koyo munechika-koyo May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check whether each axis's color is correct, not just visibility?
Checking t.get_color() == #xxxxxx, ax.yaxis.label.get_color() == #xxxxxx, ax.spines["left"].get_edgecolor() == (x, x, x, 1.0), etc. should be useful.

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.

2 participants