1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Network Analysis in Python

Exercise

CircosPlot

Finally, you're going to make a CircosPlot of the network!

Instructions

100 XP
  • Make a CircosPlot of the network, again, with GitHub users sorted by their degree, and grouped and coloured by their 'grouping' key. To do this:
    • Iterate over all the nodes in G, including the metadata (by specifying data=True).
    • In each iteration of the loop, calculate the degree of each node n with nx.degree() and set its 'degree' attribute.
    • Create the CircosPlot object c by specifying three parameters in addition to the graph G: the node_order, which is 'degree', the node_grouping and the node_color, which are both 'grouping'.
    • Draw the CircosPlot object to the screen.