MatrixPlot.savefig(filename, bbox_inches='tight', **kwargs)

Save the current figure

filename : strstr

Figure filename. Figure format is taken from the file ending unless the parameter format is given.

bbox_inches : str | NoneOptional[str] (default: 'tight')

By default is set to ‘tight’ to avoid cropping of the legends.


Passed to matplotlib.pyplot.savefig()

See also

render(): Renders the plot but does not call show(): Renders and shows the plot


>>> adata = sc.datasets.pbmc68k_reduced()
>>> markers = ['C1QA', 'PSAP', 'CD79A', 'CD79B', 'CST3', 'LYZ']
>>>, markers, groupby='bulk_labels').savefig('plot.pdf')