Skip to content

docs: add legends and colorbars example - #18

Open
timtreis wants to merge 3 commits into
mainfrom
feat/legends-colorbars
Open

docs: add legends and colorbars example#18
timtreis wants to merge 3 commits into
mainfrom
feat/legends-colorbars

Conversation

@timtreis

Copy link
Copy Markdown
Member

Summary

Adds examples/legends_and_colorbars.ipynb documenting the show() legend/colorbar surface — a large previously-undocumented API area (every coloured plot has a key).

Real 10x Visium mouse-brain dataset (squidpy.datasets.visium_hne_sdata()): spots annotated with named-region cluster labels (categorical → legend) and per-spot counts (continuous → colorbar).

Covers:

  • categorical legend placement + styling: legend_loc (matplotlib locations and '* margin'), legend_fontsize/fontweight/fontoutline, legend_title
  • na_in_legend (with groups) and the bundled legend_params dict
  • continuous colorbar on/off and colorbar_params (label, orientation, loc)
  • a legend and a colorbar side by side in a multi-panel color=[...] figure

Executed against spatialdata-plot v0.4.1, committed with outputs. Adds the examples gallery card + toctree + thumbnail.

Part of the documentation-expansion series from the 0.4.0/0.4.1 gap analysis (P1.1).

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

📖 Docs preview: https://scverse.org/spatialdata-plot-tutorials/pr-18/gallery.html

Built from 0abb582; redeployed on every push.

github-actions Bot pushed a commit that referenced this pull request Aug 18, 2026
New examples/legends_and_colorbars.ipynb on the real Visium mouse-brain
dataset (squidpy), covering the show() legend/colorbar surface:

- categorical legend placement across positions (legend_loc: matplotlib
  locations and 'right margin') and restyling (legend_fontsize/fontweight/
  fontoutline, legend_title)
- na_in_legend (with groups) and the bundled legend_params dict
- continuous colorbar on/off and colorbar_params (label, orientation, loc)
- channels_as_legend: a channel legend for a multichannel image (Xenium
  cells fluorescence)
- a legend and a colorbar side by side in a multi-panel color=[...] figure

Executed against spatialdata-plot v0.4.1; committed with outputs. Adds the
examples gallery card + toctree + thumbnail. Closes the P1.1 gap from the
0.4.0/0.4.1 doc-coverage analysis.
@timtreis
timtreis force-pushed the feat/legends-colorbars branch from d584a91 to a7f4b68 Compare August 19, 2026 02:26
github-actions Bot pushed a commit that referenced this pull request Aug 19, 2026
…efine categorical/continuous, note legend_title not a legend_params key
github-actions Bot pushed a commit that referenced this pull request Aug 19, 2026
…count), note colorbar width is an axes fraction
github-actions Bot pushed a commit that referenced this pull request Aug 19, 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