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

Different plot when running as script vs Jupyter/Console

Open LucaMarconato opened this issue 1 year ago • 0 comments

It may be related to this other bug: https://github.com/scverse/spatialdata-plot/issues/68

from spatialdata.datasets import blobs_annotating_element
import spatialdata_plot
import matplotlib.pyplot as plt

axes = plt.subplots(1, 2)[1]

sdata = blobs_annotating_element("blobs_circles")
sdata.pl.render_images("blobs_image").pl.render_shapes("blobs_circles", color="radius").pl.show(ax=axes[0])
sdata.pl.render_images("blobs_image").pl.render_shapes("blobs_circles", color="radius").pl.show(ax=axes[1])

plt.show()

In a Jupyter Notebook or Python console gives the following (correct) plot: image

While running the code as a script gives this plot: image

An observation, I guess that tests behaves like running code as scripts.

LucaMarconato avatar Sep 27 '24 12:09 LucaMarconato