Visualizing Networks in R: Arc Diagrams and Hive Plots

February 5, 2013
121 Views

Arc diagrams are an alternative way of representing two-dimensional graphs. Rather than scattering the nodes across the page connected by straight edges, you can instead arrange the nodes along a one-dimensional axis, and replace the straight edges with arcs between the nodes. While an arc diagram might not give as good a sense of the connections between the nodes as a traditional graph layout, judicious ordering of the nodes can help identify clusters.

Arc diagrams are an alternative way of representing two-dimensional graphs. Rather than scattering the nodes across the page connected by straight edges, you can instead arrange the nodes along a one-dimensional axis, and replace the straight edges with arcs between the nodes. While an arc diagram might not give as good a sense of the connections between the nodes as a traditional graph layout, judicious ordering of the nodes can help identify clusters. It’s also a useful format (especially in the vertical orientation) when you want to label each of the notes with other quantities in a table-like format.

Thanks to Gaston Sanchez, you can now create arc diagrams in R. Gaston created the arc diagram below to visualize the characters in the Victor Hugo classic (and now a major motion picture) Les Miserables. Each character is connected by an arc if they appear together in the same chapter; the wider the arc, the more the characters appeared in chapters together. The ordering (and colour) of the nodes identify groups of characters that appear in the novel together.

Arc plot diagramYou can find the complete code to create the arc diagram above, along with details on how to install the arcdiagream package, at Gaston’s blog, Data Analysis Visually Enforced.

An extension to arc diagrams is the hive plot, where instead of the nodes being laid out along a single one-dimensional axis they are laid out along multiple axes. This can help reveal more complex clusters (if the nodes represent connected people, imagine for example laying out nodes along axes of both “income” and “enthicity”), and is a particularly useful way of visualizing graphs with many nodes and edges that look like a dense “hairball” using traditional graph layouts. Here’s an example of a hive plot:

Hive plot

The above plot comes from the Hive Plots homepage, and shows the connections between similar genes (nodes) in three related genomes (SL, BA and SN). You can create hive plots in R using the hiveR package.

You may be interested

The Direst Security Breaches of 2017 and How Data Centers Are Responding
Best Practices
108 shares1,305 views
Best Practices
108 shares1,305 views

The Direst Security Breaches of 2017 and How Data Centers Are Responding

Diana Hope - June 20, 2017

Cybersecurity is becoming a tremendous concern. By 2021, security breach cost will exceed $6 trillion a year. A number of…

Why Smart Data is the Key to Future Lending
Best Practices
55 shares1,080 views
Best Practices
55 shares1,080 views

Why Smart Data is the Key to Future Lending

Patrick Köck - June 20, 2017

Last month, big data and investment trading collided on the front page of The Wall Street Journal. The article titled…

Opportunities with Merging Microsoft Access With Big Data
Big Data
75 shares1,154 views
Big Data
75 shares1,154 views

Opportunities with Merging Microsoft Access With Big Data

Rehan Ijaz - June 19, 2017

Big data may be changing some older tools in some interesting ways. Microsoft Access is a prime example. Microsoft first…