Skip to content

Instantly share code, notes, and snippets.

@GammaGames
Created January 24, 2022 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GammaGames/bff2c52ce454471dfa982857bd37da36 to your computer and use it in GitHub Desktop.
Save GammaGames/bff2c52ce454471dfa982857bd37da36 to your computer and use it in GitHub Desktop.
Make an ugly graph
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")
@GammaGames
Copy link
Author

graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment