Skip to content

fabilab/iplotx

Repository files navigation

Github Actions PyPI - Version RTD Coverage Status pylint DOI

iplotx

Banner.

Visualise networks and trees in Python, with style.

Supports:

In addition to the above, any network or tree analysis library can register an entry point to gain compatibility with iplotx with no intervention from our side.

Installation

pip install iplotx

Quick Start

import networkx as nx
import matplotlib.pyplot as plt
import iplotx as ipx

g = nx.Graph([(0, 1), (1, 2), (2, 3), (3, 4), (4, 0)])
layout = nx.layout.circular_layout(g)
fig, ax = plt.subplots(figsize=(3, 3))
ipx.plot(g, ax=ax, layout=layout)

Quick start image

Documentation

See readthedocs for the full documentation.

Gallery

See gallery.

Features

  • Plot networks from multiple libraries including networkx and igraph, using matplotlib as a backend. ✅
  • Plot trees from multiple libraries such as cogent3, ETE4, skbio, and biopython. ✅
  • Flexible yet easy styling, including an internal library of styles ✅
  • Interactive plotting, e.g. zooming and panning after the plot is created. ✅
  • Store the plot to disk thanks to the many matplotlib backends (SVG, PNG, PDF, etc.). ✅
  • Efficient plotting of large graphs using matplotlib's collection functionality. ✅
  • Edit plotting elements after the plot is created, e.g. changing node colors, labels, etc. ✅
  • Animations, e.g. showing the evolution of a network over time. ✅
  • Mouse and keyboard interaction, e.g. hovering over nodes/edges to get information about them. ✅
  • Node clustering and covers, e.g. showing communities in a network. ✅
  • Choice of tree layouts and orientations. ✅
  • Tree-specific options: cascades, subtree styling, split edges, etc. ✅
  • (WIP) Support uni- and bi-directional communication between graph object and plot object.🏗️

Authors

Fabio Zanini (https://fabilab.org)