When I draw a networkx graph in a subplot, some of the nodes are partially cut off in the frame of the axes. I've tried this with all different types of graphs and layouts, it's always a problem. It always cuts off my nodes. It's as if networkx is drawing the graph on a bigger axes than is actually there.
Here is a minimal example
plt.subplot(2, 1, 1)
plt.scatter(range(10), range(10))
plt.subplot(2, 1, 2)
G = nx.erdos_renyi_graph(20, p=0.1)
nx.draw_networkx(G)
plt.show()
This is what I get from that. As you can see, node 0 and node 7 do not fit in the frame.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…