Skip to content

Conversation

@cvanelteren
Copy link
Collaborator

Legend span inference used panel-inflated indices after prior legends added panel rows/cols, yielding invalid gridspec indices for list refs.

Decode subplot indices to non-panel grid before computing span and add regression tests for multi-legend ordering.

Closes #468

Legend span inference used panel-inflated indices after prior legends added panel rows/cols, yielding invalid gridspec indices for list refs.

Decode subplot indices to non-panel grid before computing span and add regression tests for multi-legend ordering.
@cvanelteren cvanelteren enabled auto-merge (squash) January 15, 2026 03:45
@cvanelteren cvanelteren disabled auto-merge January 15, 2026 03:46
@cvanelteren cvanelteren enabled auto-merge (squash) January 15, 2026 03:55
Add a brief note that decoding panel indices can fail for panel or nested subplot specs, so we fall back to raw indices.
@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 89.56522% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/figure.py 71.42% 4 Missing and 4 partials ⚠️
ultraplot/tests/test_legend.py 95.40% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Cover best-axis selection for left/right/top/bottom and the decode-index fallback path to raise coverage around Figure.legend panel inference.
Add tests that cover span inference with invalid ref entries, best-axis fallback on inset locations, and the empty-iterable ref fallback path.
@cvanelteren
Copy link
Collaborator Author

Docs error will be fixed on #465

@cvanelteren cvanelteren disabled auto-merge January 15, 2026 04:49
@cvanelteren cvanelteren merged commit e778482 into main Jan 15, 2026
2 of 4 checks passed
@cvanelteren cvanelteren deleted the legend-span-fix branch January 15, 2026 04:49
cvanelteren added a commit that referenced this pull request Jan 15, 2026
* Fix legend span inference with panels

Legend span inference used panel-inflated indices after prior legends added panel rows/cols, yielding invalid gridspec indices for list refs.

Decode subplot indices to non-panel grid before computing span and add regression tests for multi-legend ordering.

* Restore tests

* Document legend span decode fallback

Add a brief note that decoding panel indices can fail for panel or nested subplot specs, so we fall back to raw indices.

* Add legend span/selection regression tests

Cover best-axis selection for left/right/top/bottom and the decode-index fallback path to raise coverage around Figure.legend panel inference.

* Extend legend coverage for edge ref handling

Add tests that cover span inference with invalid ref entries, best-axis fallback on inset locations, and the empty-iterable ref fallback path.
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.

Gridspec indexing not matching with multi-legends

2 participants