Skip to content

Feature: figure semantic legends#707

Open
cvanelteren wants to merge 3 commits intomainfrom
feature/fig-semantic-legend
Open

Feature: figure semantic legends#707
cvanelteren wants to merge 3 commits intomainfrom
feature/fig-semantic-legend

Conversation

@cvanelteren
Copy link
Copy Markdown
Collaborator

Closes #706

This exposes the public API for adding semantic legends to the figure class. This PR is a shallow pass however.

Currently UltraPlot has an awkward split on the semantic legends under UltraLegend and the actual thin matplotlib wrapper for the implementation of the legend under Legend. A future refactor would need to integrate these two either through composition to reduce the overhead. It ties closely into a general refactor for the Figure class in general but is important to note regardless.

A follow-up refactor should separate semantic legend content generation from legend placement and rendering. The likely direction is a composition-based design with target-agnostic builders that return (handles, labels), and thin Axes and Figure adapters that place those legends through their respective public APIs.

@cvanelteren cvanelteren requested review from beckermr and gepcel April 29, 2026 20:36
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 97.82609% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/figure.py 96.82% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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.

Figure wide semantic legends

2 participants