code: def paga_adjacency(
          adata,
          adjacency='connectivities',
          adjacency_tree='connectivities_tree',
          as_heatmap=True,
          color_map=None,
          show=None,
          save=None):
      
      connectivity = adata.uns[adjacency].toarray()
      connectivity_select = adata.uns[adjacency_tree]
      if as_heatmap:
          matrix(connectivity, color_map=color_map, show=False)
          for i in range(connectivity_select.shape[0]):
              neighbors = connectivity_select[i].nonzero()[1]
              pl.scatter([i for j in neighbors], neighbors, color='black', s=1)
      # as a stripplot
      else:
          pl.figure()
          for i, cs in enumerate(connectivity):
              x = [i for j, d in enumerate(cs) if i != j]
              y = [c for j, c in enumerate(cs) if i != j]
              pl.scatter(x, y, color='gray', s=1)
              neighbors = connectivity_select[i].nonzero()[1]
              pl.scatter([i for j in neighbors],
                         cs[neighbors], color='black', s=1)
      utils.savefig_or_show('paga_connectivity', show=show, save=save)
docs: Connectivity of paga groups.