.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/generative_models/plot_ring_lattice.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_ring_lattice.py: ======================= Ring latting hypergraph ======================= Generate a ring-lattice hypergraph .. GENERATED FROM PYTHON SOURCE LINES 8-26 .. image-sg:: /auto_examples/generative_models/images/sphx_glr_plot_ring_lattice_001.png :alt: plot ring lattice :srcset: /auto_examples/generative_models/images/sphx_glr_plot_ring_lattice_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import xgi # specify parameters n = 10 # number of nodes s = 3 # size of hyperedges k = 4 # number of edges of which a node is a part. # generate hypergraph H = xgi.ring_lattice(n, s, k, 0) # draw hypergraph pos = xgi.circular_layout(H) xgi.draw(H, pos=pos) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.031 seconds) .. _sphx_glr_download_auto_examples_generative_models_plot_ring_lattice.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_ring_lattice.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_ring_lattice.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_ring_lattice.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_