Engaging plots, made easy.

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

from plotapi import Chord

Chord(matrix, names).show()

API for coders

Popup layout and format

The popup supports many customizations, including the text format, width, and disabling it entirely.

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"]


Popup width

We can modify the popup width with the popup_width parameter.

Chord(matrix, names, colors="set3", popup_width=100).show()

Disabling the popup

We can disable the popup with the popup_enabled parameter.

Chord(matrix, names, popup_enabled=False).show()
PlotAPI - Chord Diagram

Popup text format

We can change the noun, verb, and conjunction used in the popup text such that it is relevant for our visualisation. We can also remove them entirely and display names only.

The default looks like this:

Modified popup text

An example modification looks like this:

Modified popup text

We can modify the popup text template with the conjunction, verb, and noun parameters.

Chord(matrix, names, colors="turbo",
      conjunction="&", verb="appear together in", noun="cases").show()
PlotAPI - Chord Diagram

Showing names only

We can show only the names in the popup with the popup_names_only parameter.

Chord(matrix, names, colors="cool",
PlotAPI - Chord Diagram