import networkx as nx import matplotlib.pyplot as plt G=nx.random_geometric_graph(200,0.125) pos=G.pos # position is stored as member data for random_geometric_graph # find node near center (0.5,0.5) dmin=1 ncenter=0 for n in pos: x,y=pos[n] d=(x-0.5)**2+(y-0.5)**2 if d