Join us

Create a Chord Diagram in Python

Chord diagrams are eye catching, beautiful way to visualize inter-relationships between entities.

Each entity is represented by external nodes. Arcs show the relationship between nodes. The size of the arcs is determined by the strength of the relationship.

Visualize your data with Chord Diagram

Chord diagrams are eye catching, beautiful way to visualize inter-relationships between entities.

Each entity is represented by external nodes. Arcs show the relationship between nodes. The size of the arcs is determined by the strength of the relationship.

Chord Diagram Anatomy. Source (source)

In my opinion, the easiest way to get chord diagrams in Python is to use the Holoviews library. Documentation is here.

Let’s install Holoviews;

I will use a survey dataset for demonstration. In this survey data, data scientists were asked what they would like to learn in the next year. Answers were given in different categories. With the help of the chord diagram, we will be able to visualize the relationship between the different subjects that are wanted to be learned.

The chord diagram takes data in the form of from -> to. That is, arc has a source node and a target node. Therefore, I converted this survey data to from-to format specific to nodes.

Data

Nodes

So, the numbers in the data are the index numbers of the nodes. For example, from 0 to 4, from Language node to Data Analysis node, the value, the size of the arc is 417. It means that 417 people wanted to learn any new programming language and data analysis concept at the same time.

Ta-daa!

Chord Diagram. Image by the author.


Let's keep in touch!

Stay updated with my latest posts and news. I share insights, updates, and exclusive content.

Unsubscribe anytime. By subscribing, you share your email with @okanyenigun and accept our Terms & Privacy.

Give a Pawfive to this post!


Only registered users can post comments. Please, login or signup.

Start writing about what excites you in tech — connect with developers, grow your voice, and get rewarded.

Join other developers and claim your FAUN.dev() account now!

Developer Influence
58

Influence

6k

Total Hits

3

Posts