.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/generative_models/plot_random_simplicial_complex.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_generative_models_plot_random_simplicial_complex.py: ========================= Random simplicial complex ========================= Generate a random hypergraph. .. GENERATED FROM PYTHON SOURCE LINES 8-26 .. image-sg:: /auto_examples/generative_models/images/sphx_glr_plot_random_simplicial_complex_001.png :alt: plot random simplicial complex :srcset: /auto_examples/generative_models/images/sphx_glr_plot_random_simplicial_complex_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import xgi # specify parameters seed = 1 # fix random number generation n = 20 # number of nodes ps = [0.15, 0.01] # wiring probabilities # generate hypergraph H = xgi.random_simplicial_complex(n, ps, seed=seed) # draw hypergraph pos = xgi.barycenter_spring_layout(H, seed=seed) xgi.draw(H, pos=pos) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.039 seconds) .. _sphx_glr_download_auto_examples_generative_models_plot_random_simplicial_complex.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_random_simplicial_complex.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_random_simplicial_complex.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_random_simplicial_complex.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_