Skip to content

Instantly share code, notes, and snippets.

View parthav1's full-sized avatar

Parthav Poudel parthav1

View GitHub Profile
@JamesPHoughton
JamesPHoughton / rotate_label.md
Last active August 29, 2024 15:36
How to create rotary labels in networkx circular layout
g = nx.complete_graph([
    "playground equipment", "evanescent champagne", "curved spacetime", 
    "magic flute", "market returns", "spotty memory",
    "languid feeling", "include numpy as np", "acidic chemical", 
    "downton abbey", "tumble weeds", "precede the cause"])
node_locs = nx.circular_layout(g)
theta = {k: np.arctan2(v[1], v[0]) * 180/np.pi for k, v in node_locs.items() }