Visualizations Chord
Reverse gradients
Depending on our data, it may make more sense to reverse the gradient directions used for colouring the ribbons.
Sample data
Let's import PlotAPI and load our sample data.
from plotapi import Chord
matrix = [
[0, 5, 6, 4, 7, 4],
[5, 0, 5, 4, 6, 5],
[6, 5, 0, 4, 5, 5],
[4, 4, 4, 0, 5, 5],
[7, 6, 5, 5, 0, 4],
[4, 5, 5, 5, 4, 0],
]
names = ["Action", "Adventure", "Comedy", "Drama", "Fantasy", "Thriller"]
Demonstration
The gradient directions can be controlled with the reverse_gradients parameter. Setting it to True will reverse them.
Chord(matrix, names, reverse_gradients=True).show()