import squidpy as sq sq.gr.spatial_neighbors(adata) sq.gr.interaction_matrix(adata, cluster_key="cell type") sq.pl.interaction_matrix(adata, cluster_key="cell type")