Repository navigation
feat: style the label of Blobs.plot_centroid and each axis of Blobs.plot_axes - #269
Merged
Merged
Conversation
…lot_axes Add text_style to plot_centroid and major_style and minor_style to plot_axes, following the <thing>_style convention of rvc-ecosystem Issue 15. The axis defaults become module constants. plot_centroid no longer adds an empty text artist per blob when label is False. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 12 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds style arguments to two
Blobsplot methods, following the<thing>_styleconvention discussed in rvc-ecosystem Issue 15 (open).plot_centroid(text_style=...). Thelabel=Truetext could not be styled.text_styleis a dict of Matplotlib text options (dict(color="white", fontsize=12)), passed toplot_pointastextargs.plot_axes(major_style=..., minor_style=...). One set ofkwargsstyled both axes, so they could not be styled separately. Each axis now has its own dict. The options merge in this order, later winning: the default (new module constantsMAJOR_AXIS_STYLE, red, andMINOR_AXIS_STYLE, green, both linewidth 2), the format string,kwargs(still applied to both axes), and thenmajor_styleorminor_style. Existing calls behave as before.label,plot_centroidpassed an empty string as the text, which added an empty text artist for every blob. It now passes none.The other
Blobs.plot_*methods each draw one thing and forward*args, **kwargs, so they stay as they are.Both changes have
.. versionchanged:: 2.5.0.Tests: 10 new, covering the default axis colors, the two spellings of an option, kwargs applying to both axes, each style alone, precedence (style over kwargs over format string), the module defaults not being changed, and
text_stylewith and withoutlabel. mypy reports no issues and the full suite passes (2254 passed, 33 skipped).The styles and
kwargsmay spell an option differently (lw=3inkwargsandlinewidth=5inmajor_style), because both go throughmpl_styling(..., artist=Line2D)from PR 266 (merged) before they are merged.AI-assisted: written with Claude Code (Claude Sonnet 5.5) and reviewed by the maintainer.
🤖 Generated with Claude Code