Skip to content

fix: CannyHistogram.plot shows the figure once, not twice - #278

Merged
petercorke merged 2 commits into
mainfrom
bug/canny-histogram-shown-twice
Nov 24, 2026
Merged

petercorke merged 2 commits into
mainfrom
bug/canny-histogram-shown-twice

Conversation

@petercorke

Copy link
Copy Markdown
Owner

CannyHistogram.plot called Histogram.plot, which shows the figure, then added the th0 and th1 lines and showed it again. In a notebook that put two live views of one figure in the cell output, and the mouse readout moved in both. The first view also had no threshold lines when it was drawn.

It now passes block=None to the base plot, so that draws without showing, and shows once after the thresholds are added.

Tests: the figure is shown once (with and without ax=), and the th0 and th1 legend entries are present when the figure is shown. The first two fail on the old code. I ran the full suite and mypy, and both are clean.

AI-assisted: written with Claude Code.

🤖 Generated with Claude Code

petercorke and others added 2 commits November 24, 2026 14:27
CannyHistogram.plot called Histogram.plot, which shows the figure, then added the
threshold lines and showed it again.  In a notebook that put two live views of
one figure in the cell output, and the mouse readout moved in both.  It now draws
without showing and shows once, after the thresholds are added.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 8 complexity · 0 duplication

Metric Results
Complexity 8
Duplication 0

View in Codacy

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.

@petercorke
petercorke merged commit 1432117 into main Nov 24, 2026
34 checks passed
@petercorke
petercorke deleted the bug/canny-histogram-shown-twice branch November 24, 2026 04:50
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
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.

1 participant