what I am trying to do is to calculate degree centrality using the NetworkX library, and then change the color and sizes of the different nodes based upon this measure.
The expected result would be to have the nodes show as different colors and sizes depending on their degree centrality, but currently, they only show the default color as I have no clue what I am supposed to do this.
The csv file I use in this project is available here. https://www.mediafire.com/file/q0kziy9h251fcjf/nutrients.csv/file
The file currently has no error messages, other than that the colors sizes do not change.
I've currently tried thinking of doing some sort of list comprehension to maybe sort the problem out, but I am yet unsure how to do so, or how to set up the color map(what colors is not important)
here is the code that I am using currently.
import networkx as nx
import matplotlib.pyplot as plt
Data = open('nutrients.csv', "r")
next(Data, None)
Graph_type = nx.Graph()
G = nx.parse_edgelist(Data, delimiter=',', create_using=Graph_type,
nodetype=str, data=(('weight', float),))
deg_centrality = nx.degree_centrality(G)
print(deg_centrality)
pos = nx.spring_layout(G)
nx.draw(G, pos)
plt.show()
H

