.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/algorithms/plot_clique_centrality.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_algorithms_plot_clique_centrality.py: ============================= Clique eigenvector centrality ============================= Compute and visualize the clique eigenvector centrality. .. GENERATED FROM PYTHON SOURCE LINES 8-26 .. image-sg:: /auto_examples/algorithms/images/sphx_glr_plot_clique_centrality_001.png :alt: plot clique centrality :srcset: /auto_examples/algorithms/images/sphx_glr_plot_clique_centrality_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import xgi # generate hypergraph n = 20 ps = [0.15, 0.01] H = xgi.fast_random_hypergraph(n, ps, seed=20) # visualize hypergraph and centrality pos = xgi.barycenter_spring_layout(H, seed=1) ax, collections = xgi.draw(H, pos=pos, node_fc=H.nodes.clique_eigenvector_centrality) node_col, _, edge_col = collections plt.colorbar(node_col, label="Clique eigenvector centrality") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.050 seconds) .. _sphx_glr_download_auto_examples_algorithms_plot_clique_centrality.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_clique_centrality.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_clique_centrality.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_clique_centrality.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_