import squidpy as sq sq.gr.spatial_neighbors(adata) sq.gr.centrality_scores(adata, cluster_key="cell type") sq.pl.centrality_scores(adata, cluster_key="cell type", figsize=(20, 5), s=500)