spatialdata-plot icon indicating copy to clipboard operation
spatialdata-plot copied to clipboard

Why does the API require repeated `.pl` in a plotting command

Open grst opened this issue 5 months ago • 0 comments

Hi all,

I was wondering about the API design of spatialdata-plot: Why did you decide for requiring a pl before every plotting command in a "plotting pipeline", e.g.

sdata.pl.render_images().pl.render_shapes(color="KRAS").pl.show("downscaled_hires")

instead of just once to instantiate a plot object

sdata.pl.render_images().render_shapes(color="KRAS").show("downscaled_hires")

To me, this feels redundant and harder to read especially when the plotting commands become longer than the example above.

grst avatar Feb 14 '24 18:02 grst