Plotapi, beautiful by default.

Let plotapi do the heavy lifting – enabling beautiful interactive visualisations with a single line of code (instead of hundreds).

Get Plotapi

League of Legends Classes with Plotapi Chord

Preamble

In [1]:
from plotapi import Chord
import json

Chord.set_license("your username", "your license key")

Introduction

In this notebook we're going to use Plotapi Chord to visualise the co-occurrences between League of Legends classes. We"ll use Python, but Plotapi can be used from any programming language.

In a chord diagram (or radial network), entities are arranged radially as segments with their relationships visualised by ribbons that connect them. The size of the segments illustrates the numerical proportions, whilst the size of the arc illustrates the significance of the relationships. Chord diagrams are useful when trying to convey relationships between different entities, and they can be beautiful and eye-catching.

Dataset

We're going to use League of Legends Champion data from version 11.15.1, a copy of which is available in this documentation website. Let"s get loading the data.

In [2]:
with open("lol_classes.json", "r") as f:
    data = json.load(f)
    
names = ['Assassin', 'Fighter', 'Mage', 'Marksman', 'Support', 'Tank']

Visualisation

Let's use Plotapi Chord for this visualisation, you can see more examples in the Gallery.

We're going to adjust some layout and template parameters, and flip the intro animation on too.

Because we're using a data-table, we can also click on any part of the diagram to "lock" the selection.

In [30]:
Chord(
    data["matrix"],
    names,
    colors="league",
    details_thumbs=data["details_thumbs"],
    noun="Champions",
    thumbs_width=50,
    thumbs_margin=0,
    credit=True,
    padding=0.05,
    arc_numbers=True,
    margin=30,
    curved_labels=True,
    reverse_gradients=True,
    verb="appear together in",
    data_table=data["data_table"],
    data_table_column_width=140,
    data_table_show_indices=False,
    animated_intro=True,
    animated_duration=3000,
).show()

Made with Plotapi

You can create beautiful, interactive, and engaging visualisations like this one in any programming language with Plotapi.

Get the Books

Enjoying these notebooks and want more on the subject? Check out the practical books on Data Science, Visualisation, and Evolutionary Algorithms.

Get the books