Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix duplicate shared boxplot tick labels#630

Merged
cvanelteren merged 5 commits into
mainUltraplot/UltraPlot:mainfrom
fix/boxplot-shared-xticks-628Ultraplot/UltraPlot:fix/boxplot-shared-xticks-628Copy head branch name to clipboard
Mar 19, 2026
Merged

Fix duplicate shared boxplot tick labels#630
cvanelteren merged 5 commits into
mainUltraplot/UltraPlot:mainfrom
fix/boxplot-shared-xticks-628Ultraplot/UltraPlot:fix/boxplot-shared-xticks-628Copy head branch name to clipboard

Conversation

@cvanelteren

Copy link
Copy Markdown
Collaborator

This fixes the shared-axis boxplot regression where repeated boxplot calls on axes with sharex >= 2 could append the same fixed tick labels multiple times, making the x tick labels appear duplicated or bold. The boxplot wrapper now avoids Matplotlib's appending tick manager on already shared axes and applies the intended tick labels once, with a regression test covering the reported case. Closes #628.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes a regression in UltraPlot’s boxplot wrapper where repeated boxplot() calls on axes with stronger x-axis sharing (sharex >= 2) could accumulate duplicate fixed tick labels, causing duplicated/bold x tick label rendering. Adds a regression test for the reported scenario (issue #628).

Changes:

  • Add shared-axis detection for boxplot tick management and bypass Matplotlib’s appending tick-manager on shared tickers.
  • Install fixed tick locator/formatter once per call for shared axes to prevent duplicated tick labels.
  • Add a regression test ensuring shared x axes do not end up with duplicated tick label text.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ultraplot/axes/plot.py Avoid Matplotlib’s tick-manager path on shared tick axes and apply fixed ticks/labels without duplication.
ultraplot/tests/test_plot.py Adds regression test covering repeated boxplot calls under sharex=2 to ensure tick labels don’t duplicate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread ultraplot/tests/test_plot.py Outdated
Comment thread ultraplot/axes/plot.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@cvanelteren

Copy link
Copy Markdown
Collaborator Author

Manual inspection looks good. Merging.

@cvanelteren cvanelteren merged commit 7114cba into main Mar 19, 2026
14 of 17 checks passed
@cvanelteren cvanelteren deleted the fix/boxplot-shared-xticks-628 branch March 19, 2026 09:34
K-Mirembe-Mercy pushed a commit to K-Mirembe-Mercy/UltraPlot that referenced this pull request Mar 22, 2026
* Fix shared boxplot tick labels

* Document shared boxplot tick workaround

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

Boxplots have duplicate xtick labels when enabling x axis sharing

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.