Show labels#

Draw hypergraph with labels.

plot labels
import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
H = xgi.Hypergraph(hyperedges)


pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos, node_labels=True, node_size=15, hyperedge_labels=True)

plt.show()

Total running time of the script: (0 minutes 0.042 seconds)

Gallery generated by Sphinx-Gallery