spatialdata-plot
spatialdata-plot copied to clipboard
Plotting multiple elements in the same `ax` seems to work only when `show()` is not called.
I refer to the code mentioned in this other issue: https://github.com/scverse/spatialdata-plot/issues/68
This code here:
ax = plt.gca()
sdata.pl.render_shapes(element='s', na_color=(0.5, 0.5, 0.5, 0.5)).pl.render_points().pl.show(ax=ax)
sdata.pl.render_shapes(element='c', na_color=(0.7, 0.7, 0.7, 0.5)).pl.show(ax=ax)
plt.show()
doesn't work if I run the code as a script, but it works in interactive mode (where because of a bug the plots are not shown until I call plt.show()
). I suggest to do like scanpy and having a parameter show: bool
. I suggest also that if the parameter ax
is not None
, then show
is set to False
. I don't remember if this one is also a behavior of scanpy, but I think it's reasonable.