Skip to content

Restore colorbar frame handling - #610

Merged
cvanelteren merged 2 commits into
mainfrom
fix/colorbar-frame-param
Mar 11, 2026
Merged

Restore colorbar frame handling#610
cvanelteren merged 2 commits into
mainfrom
fix/colorbar-frame-param

Conversation

@cvanelteren

Copy link
Copy Markdown
Collaborator

This restores frame/frameon as a reliable public colorbar option again. Outer colorbars now treat it as a backwards-compatible alias for outline, while inset colorbars stop storing raw booleans as frame artists and therefore no longer crash during layout reflow when the frame is disabled.

The change also adds regression tests for both the outer and inset paths.

Closes #609

This restores frame/frameon as a reliable public colorbar option again. Outer colorbars now treat it as a backwards-compatible alias for outline, while inset colorbars stop storing raw booleans as frame artists and therefore no longer crash during layout reflow when the frame is disabled.

The change also adds regression tests for both the outer and inset paths.

Closes #609

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

Restores frame / frameon as reliable public colorbar options by treating them as a backward-compatible alias for outer colorbar outline, and by preventing inset colorbars from storing raw booleans as “frame artists” (avoiding crashes during layout reflow when the frame is disabled).

Changes:

  • Add frame / frameon parameters to the colorbar builder and route them appropriately for outer vs. inset colorbars.
  • Fix inset colorbar frame handling by storing an actual frame artist (or None) instead of a boolean.
  • Add regression tests covering both outer and inset behavior for frame=False and frameon=False.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
ultraplot/colorbar.py Accepts frame/frameon, treats them as aliases for outline on outer colorbars, and forwards inset frame intent into inset parsing.
ultraplot/axes/base.py Updates public docs and ensures inset colorbar frame state is stored as an artist (or None) instead of a boolean.
ultraplot/tests/test_colorbar.py Adds regression tests for outer frameoutline aliasing and inset frame=False not creating a frame artist.

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

Comment thread ultraplot/axes/base.py Outdated
@cvanelteren
cvanelteren enabled auto-merge (squash) March 11, 2026 00:35
@cvanelteren

Copy link
Copy Markdown
Collaborator Author

Regression is not related to the PR -- merging

@cvanelteren
cvanelteren merged commit 527d02e into main Mar 11, 2026
14 of 15 checks passed
@cvanelteren
cvanelteren deleted the fix/colorbar-frame-param branch March 11, 2026 00:47
K-Mirembe-Mercy pushed a commit to K-Mirembe-Mercy/UltraPlot that referenced this pull request Mar 22, 2026
* Restore colorbar frame handling

This restores frame/frameon as a reliable public colorbar option again. Outer colorbars now treat it as a backwards-compatible alias for outline, while inset colorbars stop storing raw booleans as frame artists and therefore no longer crash during layout reflow when the frame is disabled.

The change also adds regression tests for both the outer and inset paths.

Closes Ultraplot#609

* Clarify colorbar frame defaults in docs
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.

Error with inset colorbar when frame=False

2 participants