Skip to content

Shape's outline color from a table column #137

Closed

Description

@marcovarrone

Currently, the color of a set of shapes can be set according to a column in the table, but for the outline, it's only possible to specify a single color common to all shapes.

I would like to propose the possibility to select different outline colors for different shapes.

My use case is that I automatically generate annotated regions around certain groups of cells and I want to display only the outline because these regions can contain heterogeneous cells (colored + grey) that I still want to be able to show, as in the example in the following image.

If you think it's a good idea I can attempt a PR :)

image

Activity

  1. LucaMarconato commented on Aug 15, 2023

    @LucaMarconato
    Member

    Hi @marcovarrone, the addition of this feature would very nice, if you could propose a PR it would be super! We are happy to review it and assist you with technical questions.

  2. giovp commented on Aug 28, 2023

    @giovp
    Member

    btw should also specify that you can achieve something similar by using the contour argument, instead of the outline, which leverages https://scikit-image.org/docs/stable/api/skimage.morphology.html#skimage.morphology.erosion

  3. zhouzhendiao commented on Sep 10, 2025

    @zhouzhendiao
    Image

    Hi @marcovarrone, Recently I have been playing around with Xenium datasets using Xenium Explorer and found it very informative to visualize the morphology image with cell outlines colored by cell types.

    Since spatialdata-plot (until 0.2.11.dev18+gc5cb734) still can not control the shape's outline color by table column. Can you create a PR or share the code?

    Many thanks!

  4. timtreis commented on Mar 30, 2026

    @timtreis
    Member

    Now available in main via outline_color

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions