为什么我看不到draw_networkx_nodes绘制的图形?

时间:2018-10-19 14:52:59

标签: python matplotlib networkx

我是networkx的新手,目前在查看nx.draw_networkx_nodes绘制的图形时遇到了一些问题

我的代码部分如下所示:

for key in disease_dic.keys(): # draw the hightlighted nodes
    try:
        nx.draw_networkx_nodes(G,pos,
                       nodelist=disease_dic[key],
                       node_size=500,
                       cmap = c)
        plt.axis('off')
        plt.savefig("gene-visualization.png") # save as png
        plt.show()
    except:
        print ("the node has some error but I want to ignore it first")

我找不到该图的位置,但是我可以得到显示该图已完成的消息,如下所示(部分)

<matplotlib.collections.PathCollection object at 0x7f500e0666d8>
(-0.7793968197316616, 1.12670270848741, -0.9354918928085955, 
1.0732247260915098)
<matplotlib.collections.PathCollection object at 0x7f500e066cc0>
(-0.7793968197316616, 1.12670270848741, -0.9354918928085955, 
1.0732247260915098)
 ...
 More of this
 ...
<matplotlib.collections.PathCollection object at 0x7f500e045978>
(-0.7793969427656775, 1.1267027173825332, -0.9354931999947296, 
1.073228508267067)

0 个答案:

没有答案