You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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):
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 👍
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.
Activity
LLehner commentedon Nov 13, 2024
I guess the main plots where it's useful to wrap
spatialdata-plotwould bespatial_scatterandspatial_segmentsince the others are about visualizing statistics.LLehner commentedon Nov 13, 2024
Is the idea to replace the current
spatial_scatterandspatial_segmentwithspatialdata-plotor 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-plotare captured in memory and then put on a new grid to visualize? @LucaMarconato @timtreisA current draft implementation of mine would yield something like this for labels (using MIBI-TOF example data set):

timtreis commentedon Nov 13, 2024
Basically yeah, the core idea is that
spatialdata-plotis akin tomatplotlib, 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 callspatialdata-plotonce per gene and put that on the respectiveaxobject 👍timtreis commentedon Nov 13, 2024
The codebase of
spatialdata-plotstarted 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 tospatialdata-plotso we only fix/advance that in one place.timtreis commentedon Apr 16, 2026
Related PR that unblocks feature-parity scverse/spatialdata-plot#592
Add spatialdata-plot delegation backend (gated by feature flag)