Created
January 24, 2022 20:58
-
-
Save GammaGames/bff2c52ce454471dfa982857bd37da36 to your computer and use it in GitHub Desktop.
Make an ugly graph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import networkx | |
import itertools | |
import random | |
import matplotlib.pyplot as plt | |
G = networkx.Graph() | |
points = list(itertools.permutations(list(range(30)), 2)) | |
points = random.sample(points, 64) | |
for x, y in points: | |
G.add_node(x) | |
G.add_node(y) | |
G.add_edge(x, y) | |
f = plt.figure() | |
networkx.draw(G, ax=f.add_subplot(111)) | |
f.savefig("graph.png") |
Author
GammaGames
commented
Jan 24, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment