Python networkx做点图怎么控制点的位置

img


我所处理的点有四百多个,用networkx作图的时候点都连在一起了根本看不出来,大佬们有什么办法使这些点更分散一点吗?

node_size 可以调整点的大小
效果如图:

img

import matplotlib.pyplot as plt
import networkx as nx

options = {
    # 'node_color': 'black', # 节点颜色
    'node_size': 50,  # 每个节点大小
    'width': 3,  # 线的宽度
}

options1 = {
    'node_size': 100,  # 每个节点大小
    'width': 2,  # 线的宽度
}

options2 = {
    'node_size': 200,
    'width': 3,
}

G = nx.petersen_graph()
subax1 = plt.subplot(221)
nx.draw_random(G)
subax2 = plt.subplot(222)
nx.draw_circular(G, with_labels=True, **options)
subax3 = plt.subplot(223)
nx.draw_spectral(G, with_labels=True, **options1)
subax4 = plt.subplot(224)
nx.draw_shell(G, with_labels=True, nlist=[range(5, 10), range(5)], **options2)
plt.show()

设置点的坐标