Skip to content

Implement frameon parameter and deprecate fig in show()#573

Open
timtreis wants to merge 8 commits intomainfrom
fix/issue-204-frameon-and-fig-deprecation
Open

Implement frameon parameter and deprecate fig in show()#573
timtreis wants to merge 8 commits intomainfrom
fix/issue-204-frameon-and-fig-deprecation

Conversation

@timtreis
Copy link
Copy Markdown
Member

@timtreis timtreis commented Apr 1, 2026

Summary

  • frameon=False now calls ax.axis("off") to hide axes decorations (frame, ticks, tick labels), matching scanpy's established pattern
  • fig parameter emits a deprecation warning via logger.warning() — it was silently ignored in all single-panel code paths. The warning is suppressed when ax is a Sequence since fig is still required in that multi-panel path
  • title="" already suppressed titles; added test coverage

frameon=False now calls ax.axis("off") matching scanpy's behavior.
The fig parameter emits a deprecation warning (it was silently ignored);
the warning is suppressed when ax is a Sequence since fig is still
required in that multi-panel path.

Closes #204

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@timtreis timtreis linked an issue Apr 1, 2026 that may be closed by this pull request
timtreis and others added 5 commits April 1, 2026 15:03
Switch fig deprecation from logger.warning() to warnings.warn(DeprecationWarning)
matching the _deprecation_alias pattern used elsewhere. Add baseline-image
tests for frameon=False on single-panel and multi-panel plots.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace get_sdata_with_multiple_images fixture usage with a small helper
that adds a second coordinate system to the blobs image via
set_transformation. Keeps tests self-contained and consistent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Baseline images must be generated on the CI runner. Added
test_plot_no_decorations combining frameon=False + title="" + colorbar=False
to verify a completely clean plot output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.42%. Comparing base (e54c74f) to head (65dbacc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #573      +/-   ##
==========================================
+ Coverage   75.17%   75.42%   +0.24%     
==========================================
  Files          10       10              
  Lines        2929     2934       +5     
  Branches      681      683       +2     
==========================================
+ Hits         2202     2213      +11     
+ Misses        445      440       -5     
+ Partials      282      281       -1     
Files with missing lines Coverage Δ
src/spatialdata_plot/pl/basic.py 83.98% <100.00%> (+0.26%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

timtreis and others added 2 commits April 1, 2026 15:50
The multi-panel layout produces slight rendering differences across
Python versions (RMS ~18.4 between py3.11 and py3.14). Use a custom
tolerance of 20 instead of the default 15.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The multi-panel frameon=False test produced different title positions
across Python versions due to bbox_inches="tight" cropping differently
when axes frames are off. Adding title="" eliminates the layout-sensitive
text — the behavioral multi-panel assertion already covers title handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add example for plotting without axes decorations

2 participants