Create UMAP plots for a list of genes - running in command line

Hello All,
Thank you for taking your time reading this!
I wrote a for loop to make individual plots from sc.pl.umap(), and it’s running fine in jupyter notebook.
However, when I try to make it into a command line .py script, the python program stops at each plot generated. Does anyone has an idea on how to circumvent this problem and bypassing the showing of the plots?

for i in genelist:
     sc.pl.umap(adata, color=i, vmin=0,save='name.jpg')

Thanks again!
Quan

If you pass show=False in the plotting then an axis object is returned and nothing is plotted. I’m not sure if save then still works, but you can always save via matplotlib functions on the axis object as well.

Thank you for the suggestion! I will give that a try.