-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
When executing a script .pl.show() can execute plt.show() even when not wanted. This is because of these lines, and can be be fixed on the user side through:
import sys
if not hasattr(sys, 'ps1'):
sys.ps1 = TrueTo recreate the problem run a python file containing the following code, created tmp.png will be blank:
import spatialdata as sd
import spatialdata_plot
import matplotlib.pyplot as plt
sdata = sd.datasets.blobs()
fig, axs = plt.subplots(ncols=2)
axs[0].plot([1, 2, 3, 4], [1, 2, 3, 4])
sdata.pl.render_images('blobs_image').pl.show(ax=axs[1])
plt.savefig('test.png')The behavior is unexpected for me, I think including an show: Optional[bool]=None argument and changing the if statement to
if (not hasattr(sys, "ps1") and show is None) or show == True
plt.show()would allow for more control. Not sure if it is wanted behavior however?
Metadata
Metadata
Assignees
Labels
No labels