Good afternoon.
I'm on a shortest path finder with A* project, and for that I took some osm data with osmnx. When I want to plot my graph, I don't manage to print something good, even with changing the k parameter of spring_layout. Also, I would like to print my nodes labels, and my edges labels without printing the tuple {"weight", label}. I honestly didn't found how to make the whole thing clearer...
Do you have any idea?
if __name__ == '__main__':
Data = open('edgelist_bruxelles.csv', "r")
Graphtype = nx.MultiDiGraph()
G = nx.parse_edgelist(Data, delimiter=',', create_using=Graphtype,
nodetype=int, data=(('weight', float),))
pos = nx.spring_layout(G, 10)
nx.draw_networkx_nodes(G, pos, node_size=50)
nx.draw_networkx_edge_labels(G, pos, font_size=5)
nx.draw_networkx_edges(G, pos, edge_color='r', arrows=True)
mp.show()
What I have now
Here are some things you could consider:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.