簡體   English   中英

如何刪除networkx中的節點輪廓

[英]How to remove the contour of nodes in 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, edge_color='white', node_color='none', with_labels=True, labels=labels)
plt.show()

我的問題是,無論如何要刪除節點的輪廓? 非常感謝!

添加node_shape屬性,該屬性指定為matplotlib標記(請參閱http://matplotlib.org/api/markers_api.html )。

您只需為屬性指定None

nx.draw(G, edge_color='white', node_color='none', with_labels=True, labels=labels, node_shape=None)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM