Save plot as SVG, PDF or PNG
import scanpy as sc import matplotlib.pyplot as plt sc.pl.violin() '# plot the figure fig_used=plt.gcf() # capture the figure fig_used.set_size_inches(15,5) # adjust the width and length of this figure. the unit is inch fig_used.savefig("/home/zhiyong/Desktop/ZZZZZZZ/qc_violin_plot.pdf", format="pdf", dpi=300, bbox_inches="tight") # save the figure, one can change the format between SVG/PDF/PNG