def get_coordinates_in_circle(n):
    thetas = [(2 * np.pi * (float(i) / n)) for i in range(n)]
returnlist = [(np.cos(theta), np.sin(theta)) for theta in thetas]
return return_list
G_pc = nx.Graph()
G_pc.add_edges_from(edges_2212)
circular_positions = get_coordinates_in_circle(len(dps_2211))
fixed_nodes = [n for n in G_pc.nodes() if n in production_companies]
pos = {}
for i, p in enumerate(fixed_nodes):
    pos[p] = circular_positions[i]
colors = get_node_colors(G_pc, 'gender')
pos = nx.spring_layout(G_pc, pos=pos, fixed=fixed_nodes)
nx.draw_networkx_nodes(G_pc, pos, cmap=plt.get_cmap('jet'), node_color=
    colors, node_size=50, alpha=0.5)
nx.draw_networkx_edges(G_pc, pos, alpha=0.01)
plt.show()
Fix position of subset of nodes in NetworkX spring graph