Tutorials

Tutorials#

Entry-point material for learning the API on synthetic data.

Getting started

The fluent .pl API, layering, and styling on the in-memory blobs dataset. Ideal first read.

Getting started with spatialdata-plot
Colour and palettes

How color= resolves, the v0.3.0 groups behaviour, and building perceptually well-spaced or colourblind-safe palettes with make_palette and make_palette_from_data.

Colour and palettes in spatialdata-plot
Multi-panel colouring

Render several colourings at once by passing a list to color=, scanpy-style, with per-panel legends/colourbars, shared palette/cmap, and ncols grid control.

Multi-panel colouring in spatialdata-plot
Speeding up rendering

Keep rendering fast on large data: automatic rasterization and scale selection for images, and the datashader backend for large collections of shapes and points.

Speeding up the rendering of large data
Rendering elements as points

Draw shapes and label masks as one dot per centroid with as_points=True — a fast overview that trades geometry for speed, including the matplotlib → datashader switch above ~50k elements.

Rendering elements as points with as_points
Scalebars

Add a physical scalebar with scalebar_dx, choose units, and style placement, colour, length and fonts through scalebar_params.

Scalebars in spatialdata-plot