Parallel axis plots (here is a good description of what they are) are a relatively recent development in the plotting world, so it is no surprise that there is no implementations of it with more than basic functionalities in the major plotting packages available online. Over the past couple of days I then created my own implementation of parallel axis plots in Python using Matplotlib — Pandas’ and Plot.ly’s implementation get cumbersome when the user tries to apply brushing and multiple color gradients — to create versatile, high-resolution and story-telling plots for my next papers and presentations. This implementation allows for:

Plotting multiple datasets,

Displaying dataset names,

Choosing columns to be plot,

Coloring each dataset based on a column and a different Matplotlib color map,

Specifying ranges to be plotted,

Inverting multiple axis,

Brushing by intervales in multiple axis,

Choosing different fonts for title and rest of the plot, and

Export result as a figure file or viewing plot in Matplotlib’s interactive window.

The source code can be found here, and below is an example of how to use it:

import numpy as np from plotting.parallel_axis import paxis_plot from matplotlib.colors import LinearSegmentedColormap from matplotlib import cm bu_cy = LinearSegmentedColormap.from_list('BuCy', [(0, 0, 1), (0, 1, 1)]) bu_cy_r = bu_cy.reversed() data1 = np.random.normal(size=(100, 8)) data2 = np.random.normal(size=(100, 8)) columns_to_plot = [0, 1, 3, 5, 7] color_column = 0 axis_labels = ['axes ' + str(i) for i in range(8)] dataset_names = ['Data set 1', 'Data set 2'] plot_ranges = [[-3.5, 3.5]] * 3 + [[-2.9, 3.1]] + [[-3.5, 3.5]] * 4 axis_to_invert = [1, 5] brush_criteria = {1: [-10., 0.], 7: [10., 0.]} paxis_plot((data1, data2), columns_to_plot, color_column, [bu_cy_r, cm.get_cmap('autumn_r')], axis_labels, 'Title Here', dataset_names, axis_ranges=plot_ranges, fontname_title='Gill Sans MT', fontname_body='CMU Bright', file_name='test.png', axis_to_invert=axis_to_invert, brush_criteria=brush_criteria)

The output of this script should be a file named “test.png” that looks similar to the plot below: