Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Delegate plots to spatialdata-plot #912

Open
LucaMarconato opened this issue Nov 8, 2024 · 4 comments
Open

Delegate plots to spatialdata-plot #912

LucaMarconato opened this issue Nov 8, 2024 · 4 comments

Comments

@LucaMarconato
Copy link
Member

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.

@LLehner
Copy link
Member

LLehner commented Nov 13, 2024

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.

@LLehner
Copy link
Member

LLehner commented Nov 13, 2024

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

@timtreis
Copy link
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 👍

@timtreis
Copy link
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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants