skojaku / core-periphery-detection

Python package for detecting core-periphery structure in networks.
Apache License 2.0
47 stars 5 forks source link

A problem about example.py #21

Closed Lyrics1997 closed 2 years ago

Lyrics1997 commented 2 years ago

Hi, When studying the example2 you provided, I found this error when running ‘’ax, pos = cpnet.draw(G, c, x, ax)‘’

The error is below:

/usr/local/lib/python3.7/dist-packages/cpnet/utils.py in set_node_colors(c, x, cmap, colored_nodes) 60 ) 61 bounds = np.linspace(0, 1, 11) ---> 62 norm = mpl.colors.BoundaryNorm(bounds, ncolors=12, extend="both") 63 64 # Calculate the color for each node using the palette

TypeError: init() got an unexpected keyword argument 'extend'

I use colab to run this example. How to solve this ?

Thank you in advance!

skojaku commented 2 years ago

Sorry for my late response. This is due to the incompatibility of the matplotlib version. You can resolve the issue by upgrading matplotlinb.