Plotting repertoire overlap as a heatmap with scirpy

Hi ,
I’m struggling with scripy’s “ir.pl.repertoire_overlap” function. I would like to modify the heatmap label.size as my labels are quite long and its not obvious to me how best to do this . As currently the heatmap is being scrunched up.

Best
Devika

Hi Devika,

the pl.repertoire_overlap function returns a ClusterGrid object as generated by the seaborn.clustermap function.

You can manipulate the ClusterGrid object. In this example I’m setting the xlabel size to a smaller value:

import matplotlib.pyplot as plt

g = ir.pl.repertoire_overlap(
    adata,
    "sample",
    heatmap_cats=["patient", "source"],
    yticklabels=True,
    xticklabels=True,
)
g.ax_heatmap.set_xticklabels(g.ax_heatmap.get_xticklabels(), fontsize=5)
plt.show()

Thank you very much. i was struggling with this for a while, as the styling arguments within the functions werent working

1 Like