Skip to main content

A library for ploting chord diagrams

Project description

OpenChord

OpenChord is a Python library I am developing to plot beautiful chord diagrams for visualising networks and graphs. OpenChord uses the drawsvg library and can display figures in a Jupyter notebook or Jupyter lab. Other libraries for drawing chord diagram includes PlotAPI (paid), Bokeh (visible moire artifact), and Plotly (tedious).

Installation

OpenChord is now on PyPI.org! Install using the command

python3 -m pip install openchord

Usage

Currently, the function only support symmetric adjacency matricies (i.e. weighted graph, non-directed)

import openchord as ocd

adjacency_matrix = [[ 3, 18,  9,  0, 23],
                    [18,  0, 12,  5, 29],
                    [ 9, 12,  0, 27, 10],
                    [ 0,  5, 27,  0,  0],
                    [23, 29, 10,  0,  0]]
labels = ['Emma', 'Isabella', 'Ava', 'Olivia', 'Sophia']

fig = ocd.Chord(adjacency_matrix, labels)
fig.show()

Color can be changed like so

fig.color_map = ['#636EFA', '#EF553B', '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3', '#FF6692', '#B6E880', '#FF97FF', '#FECB52']
fig.show()

You can export the figure as an .svg file and open it in a vector graphics software such as Inkscape

fig.save_svg("figure.svg")

Chord diagram using OpenChord

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openchord-0.1.4.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openchord-0.1.4-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file openchord-0.1.4.tar.gz.

File metadata

  • Download URL: openchord-0.1.4.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for openchord-0.1.4.tar.gz
Algorithm Hash digest
SHA256 340d01af70720936a17c89b9b72740bd86c6843a9954923d0f0882acfc690be1
MD5 48a6ed4ceddd6f67190403a4af4415da
BLAKE2b-256 dca558717a8a9c4c1dfc6b72641f96756c1de6f2029654cc0110f65473b6abf6

See more details on using hashes here.

File details

Details for the file openchord-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: openchord-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for openchord-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6b161988f0498db9d9d054a61be60e877be2ab757343d0e78416c4b3348a1b93
MD5 a81f6bde4fc0246631984497cba116d8
BLAKE2b-256 8e694737248d7dcdffb9d22385ff32ddaa71594a2bc7edb714084f3a27a77caf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page