Skip to content

Skip plt.show() when user supplies ax= to allow multi-call layering#569

Merged
timtreis merged 1 commit intomainfrom
fix/issue-362-show-with-user-ax
Mar 30, 2026
Merged

Skip plt.show() when user supplies ax= to allow multi-call layering#569
timtreis merged 1 commit intomainfrom
fix/issue-362-show-with-user-ax

Conversation

@timtreis
Copy link
Copy Markdown
Member

@timtreis timtreis commented Mar 30, 2026

Summary

  • When show=None (default) and the user provides their own axes via ax=, default show to False instead of auto-detecting interactive mode.
  • This allows multiple .pl.show(ax=...) calls to accumulate content on the same axes without plt.show() consuming the figure in between.
  • Follows the same convention as scanpy, where user-supplied axes imply user-managed figure lifecycle.

Closes #362. Also addresses the root cause of #71.

…362)

When show=None (default) and the user provides their own axes via ax=,
default show to False instead of auto-detecting interactive mode. This
allows multiple .pl.show(ax=...) calls to accumulate content on the
same axes without plt.show() consuming the figure in between.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.47%. Comparing base (55d59b7) to head (8e5a884).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #569      +/-   ##
==========================================
+ Coverage   75.39%   75.47%   +0.07%     
==========================================
  Files          10       10              
  Lines        2906     2907       +1     
  Branches      672      672              
==========================================
+ Hits         2191     2194       +3     
  Misses        431      431              
+ Partials      284      282       -2     
Files with missing lines Coverage Δ
src/spatialdata_plot/pl/basic.py 83.16% <100.00%> (+0.74%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timtreis timtreis merged commit 82ad066 into main Mar 30, 2026
8 checks passed
@timtreis timtreis deleted the fix/issue-362-show-with-user-ax branch March 30, 2026 22:48
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.

Cannot combine shapes and images on the same axes in separate calls.

2 participants