Repository navigation
fix: label the x axis of the Canny histogram "gradient magnitude", and add xlabel to Histogram.plot - #280
Merged
Conversation
…d add xlabel to Histogram.plot The Canny histogram is of gradient magnitude but its x axis said "pixel value". Histogram.plot now takes an xlabel argument, whose default is the old label, and CannyHistogram.plot defaults it to "gradient magnitude". Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 1 high |
🟢 Metrics 12 complexity · 0 duplication
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.
The histogram returned by
Image.canny(hist=True)is of gradient magnitude, but its x axis said "pixel value".Histogram.plotnow takes anxlabelargument. Its default keeps the old label ("pixel value", or "bin rank" for a sorted histogram), so other histograms are unchanged.CannyHistogram.plotdefaults it to "gradient magnitude", for every plot type and style. Any histogram can now be relabelled, for exampleim.hist().plot(xlabel="grey level").Tests: the Canny label for each type, a caller's own label, the
ax=case, the plain histogram defaults, and the stack and overlay styles. I ran the full suite and mypy, and both are clean.Not covered here:
plot(type="cf")andtype="cumulative"fail on a single-plane histogram, which is a separate bug.AI-assisted: written with Claude Code.
🤖 Generated with Claude Code