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()

API for coders

Ticks

PlotAPI Chord supports displaying and formatting ticks around the diagram.


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 visibility and total number of ticks can be controlled with the ticks parameter. Setting it to a number greater than 0 will display the ticks.

The ticks_color parameter will set the color of the tick lines.

The ticks_font_size parameter will set the size of the tick labels.

The ticks_font_color parameter will set the color of the tick labels.

The ticks_label_format parameter will string format the tick labels.

Ticks enabled

Chord(matrix, names, colors="cividis", curved_labels=True,
      ticks=45).show()

Ticks styling and formatting

Blue tick lines, size 14 and purple tick labels.

Chord(matrix, names, colors="viridis",
      ticks_color="blue",
      ticks_font_size=14,
      ticks_font_color="purple",
      ticks=30).show()
PlotAPI - Chord Diagram

180 ticks, black tick lines, size 7 and black tick labels.

Chord(matrix, names, colors="set2", curved_labels=True,
      ticks_color="black",
      ticks_font_size=7,
      ticks_font_color="black",
      ticks=180).show()
PlotAPI - Chord Diagram

360 ticks, transparent tick labels.

Chord(matrix, names, colors="turbo", curved_labels=True,
      ticks_font_color="transparent",
      ticks=360).show()
PlotAPI - Chord Diagram
Previous
Chord