ComeçarComece de graça

Visualizing using Arc plots

Following on what you've learned about the nxviz API, now try making an Arc plot of the network. Two keyword arguments that you will try here are sort_by='keyX' and node_color_by='keyX', in which you specify a key in the node metadata dictionary to color and order the nodes by.

matplotlib.pyplot has been imported for you as plt.

Este exercício faz parte do curso

Introduction to Network Analysis in Python

Ver curso

Instruções do exercício

  • Import arc from nxviz.
  • Create an un-customized Arc plot of T. To do this, use the arc() function with just T as the argument.
  • Create another Arc plot of T in which the nodes are ordered and colored by the 'category' keyword. You'll have to specify the sort_by and node_color_by parameters to do this. For both plots, be sure to draw them to the screen and display them with plt.show().

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Import necessary modules
import matplotlib.pyplot as plt
____

# Create the un-customized Arc plot: a
a = ____

# Display the plot
plt.show()

# Create the customized Arc plot: a2
a2 = ____

# Display the plot
plt.show()
Editar e executar o código