Add title to scanpy.pl.heatmap

Hello
I am trying to learn how to add elements to scanpy plots for example, adding a title to a heatmap. Is there a way to do this?

from matplotlib import pyplot as plt

marker_genes_dict = [
“EPCAM”,“KRT8”,“KRT9”
]

sc.tl.dendrogram(adata_epi_subset, ‘leiden’, n_pcs=23)
ax1 = sc.pl.heatmap(adata_epi_subset, marker_genes_dict, groupby=‘leiden’, show_gene_labels=False, vmin=-4, vmax=4, cmap=‘RdBu_r’, dendrogram=True, use_raw=True, swap_axes=True, figsize=(5,5))

#ax1.set(title=‘Test’, ylabel=‘Test2’)
#ax1.title(“z”)

AttributeError: ‘NoneType’ object has no attribute ‘title’

This is a small and annoying issue of missing documentation:
sc.pl.heatmap only returns something if not show, meaning if you pass show=True, and then it returns a dictionary of axes, from which you should select ax1['heatmap_ax']

For future incidents like this (and the way i figured the answer): you can follow the function to the actual code, and look at the return statement.

Thank you very much for your guidance!