Social Network Visualization Using Python
For this assignment, I created a simple undirected social network graph using Python, NetworkX, and Plotnine. The goal was to build a small network, convert it into a DataFrame, and visualize it using a ggplot2-style plotting library. Process & Reflection To start, I generated a random graph with 10 nodes using the gnp_random_graph() function in NetworkX. This part worked really well, NetworkX makes it extremely easy to build graph structures and assign attributes like labels. I labeled each node from A through J and used the spring layout algorithm to position everything. Converting the graph into two pandas DataFrames (one for nodes and one for edges) turned out to be helpful because Plotnine works best when the data is structured in a tidy format. The visualization step was surprisingly smooth. Since Plotnine is based on ggplot2, the syntax felt familiar: I used geom_segment to draw the connections, geom_point for th...