Python 如何删除networkx中节点的轮廓
我正在使用python中的networkx为emojis绘制一个网络。这是我的密码:Python 如何删除networkx中节点的轮廓,python,networkx,Python,Networkx,我正在使用python中的networkx为emojis绘制一个网络。这是我的密码: G = nx.Graph() # emoji_sim is a nested list contains cosine similarity of each emojis pair. G = nx.from_numpy_matrix(np.array(emoji_sim)) labels=dict(zip(range(len(G.nodes())),emoji_dict.values())) nx.draw
G = nx.Graph()
# emoji_sim is a nested list contains cosine similarity of each emojis pair.
G = nx.from_numpy_matrix(np.array(emoji_sim))
labels=dict(zip(range(len(G.nodes())),emoji_dict.values()))
nx.draw(G, edge_color='white', node_color='none', with_labels=True, labels=labels)
plt.show()
我的问题是,是否仍然需要删除节点的轮廓?非常感谢 添加
node\u shape
属性,该属性的指定方式类似于matplotlib标记(请参见)
您只需为属性指定None
:
nx.draw(G, edge_color='white', node_color='none', with_labels=True, labels=labels, node_shape=None)
谢谢你的快速回复!如何使用
nx.draw\u networkx\u nodes
命令而不是nx.draw
为边节点使用某种颜色?