I've been trying to visualize a network I made with greater definition, and thought that saving it as a .jpg could make it easier to draw nodes apart.
edges,weights = zip(*nx.get_edge_attributes(graph_data,'weight').items())
pos = nx.kamada_kawai_layout(graph_data)
nx.draw_networkx(graph_data, pos, node_color='purple', edgelist=edges,
edge_color=weights, width=5.0, edge_cmap=plt.cm.jet)
plt.savefig("filepath.png")
However, I got stumped when trying to use the plt.savefig() function. The filepath always remains empty, with just a blank picture. Am I missing something important?