Case study part II: Visualization
1. Case study part II: Visualization
Great work completing the previous exercises! In this next portion of the case study, we're going to practice network visualizations2. nxviz API
Do you remember the nxviz API? If not, no worries, we're going to run through it again. Suppose we have a graph G that we'd like to visualize. To do a basic Circos plot with no attention provided to styling, you would do: circ equals nv-dot-circos(G) - basically passing the graph G into the `circos` function. You can also choose to style the plot by passing in keywords that declare on which keys to style them. Then, after calling p-l-t-dot-draw, your Circos plot will be drawn to screen. Recall too that there's not just Circos plots, but a whole variety of network plots available in nxviz. In the coming exercises, you will be practicing drawing not just Circos plots, but also Hive plots and Arc plots. In the coming exercises, you will also use one new function present in NetworkX that hasn't been introduced before, so I will take some time to introduce it here - it is the3. Connected component graphs
"connected component" concept. To help you visualize this idea, let's take this graph here. There are two connected components in this graph, the one on the left containing the yellow node, and the one on the right containing the purple node. Notice how there are no edges connecting the left graph to the right. This is thus the definition of a connected component: a set of nodes connected to one another by some path in the graph, and not connected to other nodes in the graph.4. NetworkX API
Using the example shown on the slides, I have a graph G constructed using one of NetworkX's graph constructors. Using the nx-dot-connected_component function and passing in the graph G, I can see that it is a generator. To get a list of all of the connected component, I can cast it as a list. In this example, there's are two connected components, and if we print out their sizes, one has 99 nodes and one has 1 node. That one isolated node cannot be accessed from any of the other 99 nodes in the graph, because no edge exists between that node and other nodes.5. Let's practice!
Now that you've had a refresher, go forth and try out the exercises!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.