Engaging plots, made easy.

Easily turn your data into engaging visualizations. Powerful API for coders. Powerful app for everyone.

main.py
notebook.ipynb
main.rs
from plotapi import Chord

Chord(matrix, names).show()

Visualizations Chord

Chord colors

The color scheme can be set to one of many beautiful presets, or even a customized by supplying a list of colors (HEX, RGB, etc.).


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

To specify chord colors, we can set the colors parameter to one of the following:

  • A list of color strings, e.g. ["#264653","#2a9d8f","#e9c46a","#f4a261","#e76f51"]. If there are fewer colors than there are categories, PlotAPI Chord will loop round the colors.
  • The name of a color scheme from one of the many beautuful presets.

The default color scheme is "rainbow". Let's try a few different color schemes.

Chord(matrix, names, colors="cool").show()
Chord(matrix, names, colors="red_yellow_blue").show_png()
Notebook PNG image
Chord(matrix, names, colors=["#B8D0EB", "cyan", "rgb(111,45,189)"]).show_png()