I have a network consisting of more than 300 nodes that have coordinates as attributes. My node attributes look like this:
print(EL.nodes(data = True))
[(1, {'label': 'Aachen', 'Country': 'DE', 'Population': 248960.0, 'lat': 50.7762, 'lon': 6.0838}), ...]
I would like to plot the nodes and edges on a map, so respecting the lat and lon information I have. I tried using this code:
pos = nx.spring_layout(EL)
nx.draw(EL, nx.get_node_attributes(EL, 'pos'), with_labels=True, node_size=1)
But it gives me an error Node 1 has no position
Looking online, I tried to use alternative solutions using Basemap or mplleaflet but I cannot install either via the Anaconda prompt. If I try via the Anaconda navigator, I get this:
Output in format: Requested package -> Available versions
I've been browsing similar threads on Stackoverflow where people had similar problems, but nothing works. For instance, I checked those threads: Python basemap module impossible to import
Drawing nodes with coordinates in correct position using NetworkX/Matplotlib
Can anyone help me plot this network? Thanks a lot