Skip to content

docs: add a Scalebars tutorial#12

Open
timtreis wants to merge 4 commits into
mainfrom
feat/scalebar-tutorial
Open

docs: add a Scalebars tutorial#12
timtreis wants to merge 4 commits into
mainfrom
feat/scalebar-tutorial

Conversation

@timtreis

@timtreis timtreis commented Jul 10, 2026

Copy link
Copy Markdown
Member

Adds a Scalebars tutorial to the tutorials/ gallery.

A focused tutorial on drawing physical scalebars via the scalebar_* arguments
of .pl.show(), on the synthetic blobs dataset:

- scalebar_dx (the one required piece) and why it's needed: SpatialData
  coordinate systems carry no unit metadata, so you supply the physical size
  of one axes-unit.
- scalebar_units and automatic magnitude scaling (um -> mm).
- styling via scalebar_params (placement, colour, box, length_fraction,
  scale_loc, fonts) - forwarded verbatim to matplotlib-scalebar.
- fixed_value for an exact bar length.
- cross-links the Visium example for a real-data figure.

Wired into the gallery: card in tutorials/index.md (inside the gallery-cards
markers, root-relative paths) + toctree entry + thumbnail. Addresses part of
scverse/spatialdata-plot#463.
@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 Jul 10, 2026

Copy link
Copy Markdown

📖 Docs preview: https://scverse.org/spatialdata-plot-notebooks/pr-12/gallery.html

Built from 8bfdc87; redeployed on every push.

github-actions Bot pushed a commit that referenced this pull request Jul 10, 2026
… cells

Those two cells set color="white" but relied on matplotlib-scalebar's default
white box, so the bar landed on the box and vanished. Give them a translucent
dark box (box_color/box_alpha), and add a note to the appearance section that
white bars on a dark image need a dark box or frameon=False.
github-actions Bot pushed a commit that referenced this pull request Jul 10, 2026
- Prose pass on the scalebar tutorial markdown cells.
- Regenerate the gallery thumbnail from the notebook's final plot: no
  title/axes, landscape ~1.11 ratio to match the sibling cards.
- CONTRIBUTING: reference assets by the submodule-mount paths (absolute
  /notebooks/... for index.md cards, relative ../ from notebook cells).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
github-actions Bot pushed a commit that referenced this pull request Jul 12, 2026
- New §5 demonstrating a vertical bar (`rotation`) and a custom bar title
  (`label`/`label_loc`); old wrap-up renumbered to §6.
- Regenerate the gallery thumbnail from this final plot: vertical 100 µm
  bar with a "scale" label, landscape ~1.11 to match the sibling cards.
- Re-executed end-to-end so committed outputs are current.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
github-actions Bot pushed a commit that referenced this pull request Jul 12, 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