skojaku / core-periphery-detection

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

Draw questions #17

Closed yengogo closed 3 years ago

yengogo commented 3 years ago

Hello skojaku, I recently use cpnet for some research, and i have few questions need to ask you

When I use cpnet.draw() to show my network, there are many 'gray' nodes on my result picture, and they covered the other color nodes😓

Could you explain what is the meaning of those gray nodes? Is there a way to remove those gray node?

Thank you!

image

skojaku commented 3 years ago

Opp, the colored nodes should be in front and this is a bug. Thanks for reporting this.

The grey nodes are those not belong to any of the detected groups, which we call "residual nodes". From our perspective, they are a kind of noise because they do not constitute a core-periphery structure, which is our main interest.

yengogo commented 3 years ago

@skojaku thank you for reply!! Is it possible to fix this problem from networkx.draw? or remove these nodes before plot network?

skojaku commented 3 years ago

I added a new argument to remove the grey colored nodes:

cpnet.draw(G, pair_ids, coreness, ax, max_group_num = 2)

max_group_num is the new argument that controls the number of groups to draw. You can remove the colored nodes by setting this to the number of core-periphery groups you detected.

skojaku commented 3 years ago

The new cpnet version is 0.0.20. So, don't forget to update cpnet using pip.

yengogo commented 3 years ago

@skojaku thank you so much ! The new picture looks better !! I appreciative your help !

skojaku commented 3 years ago

I'm glad to hear! Once again, thanks for raising the issue!