Skip to content

Delegate plots to spatialdata-plot #912

Open

Description

@LucaMarconato

Cowritten with @timtreis.

Many functions in squidpy essentially generate similar plots like we do in spatialdata-plot (it precedes spatialdata-plot) and was the basis of it.
It’d reduce maintenance effort if we pivot those functions to delegate to spatialdata-plot.
We could establish convenience wrappers for “plot the same plot with 3 genes”: example notebook here.
See further discussion here.

Activity

  1. LLehner commented on Nov 13, 2024

    @LLehner
    Member

    I guess the main plots where it's useful to wrap spatialdata-plot would be spatial_scatter and spatial_segment since the others are about visualizing statistics.

  2. LLehner commented on Nov 13, 2024

    @LLehner
    Member

    Is the idea to replace the current spatial_scatter and spatial_segment with spatialdata-plot or also add different plotting capabilities?
    If one wants the "classic" 4 plots in a row graphic, should it just be a wrapper in the sense that the plots from spatialdata-plot are captured in memory and then put on a new grid to visualize? @LucaMarconato @timtreis

    A current draft implementation of mine would yield something like this for labels (using MIBI-TOF example data set):
    Image

  3. timtreis commented on Nov 13, 2024

    @timtreis
    Member

    Basically yeah, the core idea is that spatialdata-plot is akin to matplotlib, basically just delivering the base plotting capability. And anything fancy is then a wrapper around that. So, as you said, in that case a squidpy function would keep it's old interface but then just call spatialdata-plot once per gene and put that on the respective ax object 👍

  4. timtreis commented on Nov 13, 2024

    @timtreis
    Member

    The codebase of spatialdata-plot started out as some chimera between Squidpy's plotting and a prototype from Harald, but has matured a lot since. So we're essentially maintaining duplicate code. Ideally, we can remove a lot of the spatial plotting code from Squidpy and fully delegate to spatialdata-plot so we only fix/advance that in one place.

  5. timtreis commented on Apr 16, 2026

    @timtreis
    Member

    Related PR that unblocks feature-parity scverse/spatialdata-plot#592

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions