Unified Plotting

Welcome! You’ve found the documentation of the Python 3 package unified-plotting.

TL;DR - Let’s start right away with a small code example:

import networkx as nx
import unified_plotting as up

fig = up.matplotlib.scatter(x=[1, 2, 3, 4, 5, 6], y=[1, 1, 2, 3, 5, 8], show_line=True)

fig = up.plotly.scatter_3d(x=[1, 2, 1, 2], y=[2, 4, 4, 2], z=[2, 3, 5, 8], show_interpolation_rbf=True)

fig = up.javascript.network_d3(nx.les_miserables_graph())


fibonacci.png ← static scatter plot
interpolation.html ← interactive 3D scatter plot
les_miserables.html ← interactive network visualization

Alternatives to such file output: 1) Displaying in browser 2) Embedding in notebook 3) Text representation

What is this package?

unified-plotting is an open-source software package for quick and easy plotting in Python 3. It provides a simple, unified interface to access Matplotlib, Plotly, d3.js and other data visualization libraries. The main goal is to reduce the complexity of generating various plots of two common types of data:

  1. Tabular data (a.k.a. vector data, array data)
  1. Linked data (a.k.a. graph data, network data)

More about What …?

Why is it relevant?

Creating plots is a frequent but often tedious task, which can be greatly simplified to become less cumbersome and time consuming. Existing plotting libraries for Python are rich in capabilities and options, yet all this flexibility makes their usage more complicated. The effect is that it introduces a cognitive overhead that can limit their actual application in practical settings. By lowering the complexity of creating common plot types, data may get visualized more often and in a greater diversity of representations, potentially leading to better insights and decisions.

More about Why …?

When should it be used?

Whenever you deal with vector data (e.g. when using Pandas, NumPy, scikit-learn, DSV files) or graph data (e.g. when using NetworkX, igraph, graph-tool) this package enables you to quickly translate it into static and interactive visual representations (e.g. for exploratory data analysis or visual analytics).

Who may benefit from it?

This package may help anybody who wants to quickly generate decent looking plots with Python 3, without having to memorize or repeatedly look up API details of different plotting packages. It may also help in cases where precision is needed, such as exact plot, margin, font, marker and line sizes specified in a desired size unit such as inch, mm or pt (1 inch = 25.4 mm = 72 pt), which behind the scenes needs quite some trickery for certain libraries.

More about Who …?

How can you get started?

  • The installation guide explains how to download and install the package.
  • The quickstart examples provide a first impression of the package. The code can also be used as a check whether your local installation works.
  • The plot overview examples give a tour of all plotting functions provided by this package. They can be used to see the range of available features and may serve as copy-and-paste templates.
  • The configuration overview examples explain the configuration system, which allows to define global plotting options and reusable styles that can be shared with others.
  • The graphical user interface demo introduces the browser-based GUI that is part of this package. It enables the input of data and generation of all plot types without writing a line of code.
  • The format specification defines special purpose data formats used by this library. Currently this is restricted to the JSON graph format (JGF) for defining linked data, i.e. graphs with properties.
  • The API documentation is the single source of truth for all details about each plotting function available in this package.

Where is everything located?

The package reference page contains links to all parts of this project, which includes source code (tests, docs, examples), packaged code for distribution and documentation.