The default behaviour of PlotAPI chord is to represent both sides of a relationship with a single chord. However, it may be more suitable to use two different chords with arrows to indicate the dimension of a relationship.
Let's import PlotAPI and load our sample data.
from plotapi import Chord matrix = [ [0, 5, 6, 4], [2, 0, 5, 4], [6, 5, 0, 4], [2, 4, 3, 0], ] names = ["Action", "Adventure", "Comedy", "Drama"]
To enable directed mode, we only need to set the
directed parameter to
Chord(matrix, names, directed=True, colors="spectral").show()
The directed Chord diagram can be paired with
reverse_gradients=True to make it easier to see where inbound/outbound relationships are coming from or going to.
Chord(matrix, names, directed=True, colors="spectral", reverse_gradients=True).show()