This skill covers plotting spatial transcriptomics expression, clusters, and continuous scores on a tissue section with Squidpy and Scanpy. The central decisions are which plotter and marker size to use for the platform fork (spot/capture like Visium and Slide-seq versus imaging/FOV like Xenium, MERFISH, and CosMx), how to align points to the histology image with the correct coordinate-frame transform, and how to avoid rendering choices -- interpolation, oversized markers, misleading colormaps, non-metric embedding distances -- that manufacture structure the assay never measured.
pip install squidpy scanpy anndata matplotlib
# Optional perceptually-uniform colormaps and interactive viewers:
pip install cmcrameri napari vitessce
Tell your AI agent what you want to do: - "Plot CD3D expression on the Visium tissue with the histology image" - "Show clusters on my Xenium section as a cell point cloud" - "Color spots by a continuous score without smoothing the field" - "Make a publication panel with a perceptually-uniform colormap"
"Overlay leiden clusters on the H&E image using the dataset scalefactors and a spot size matching the capture diameter"
"Plot total counts and these marker genes side by side on the tissue"
"Plot cell types as a point cloud in micron coordinates without a spot lattice"
"Overlay transcripts on the DAPI image with the correct micron-to-pixel transform"
"Show this spatial score on the measured spots only, no interpolation, with a perceptually-uniform colormap and a disclosed p99 clip"
"Open this section in napari with the tissue image and spots aligned in pixel space"
scanpy.pl.spatial, size scales the spot diameter; oversizing it fakes tissue coverage the assay did not resolve.squidpy.pl.spatial_scatter with no image, size is the actual dot size -- keep it small for sparse imaging detections.