Exercise

Plot number of edge changes over time

You're now going to make some plots! All of the lists that you've created before have been loaded for you in this exercise too. Do not worry about some of the fancy matplotlib code that shows up below: there are comments to help you understand what's going on.

Instructions

100 XP
  • Plot the number of edges added over time. To do this:
    • Use a list comprehension to iterate over added and create a list called edges_added. The output expression of the list comprehension is len(g.edges()), where g is your iterator variable.
    • Pass in the edges_added list to ax1.plot().
  • Plot the number of edges removed over time. Once again, use a list comprehension, this time iterating over removed instead of added.
  • Plot the fractional changes over time by passing it in as an argument to ax2.plot().