STOmics / Stereopy

A toolkit of spatial transcriptomic analysis.
MIT License
184 stars 64 forks source link

how to save graphs NOT in interactive mode #304

Closed BioRB closed 1 month ago

BioRB commented 1 month ago

Hello, I would like to save graphs from command line and NOT usign the interactive buttons and slots that appear when we use .plt.spatial_scatter or whatever plt. how can I do that? thanks.

BioRB commented 1 month ago

solved: `from matplotlib import pyplot as plt

with plt.rc_context(): # Use this to set figure params like size and dpi ms_data.plt.cluster_scatter(res_key='annotation', reorganize_coordinate=4) plt.savefig("./annotation.png", bbox_inches="tight")`