This package is an attempt to implement the idea of parallel coordinates from Sébastien Tricaud and Philippe Saadé to general purposes.
from paracoord import get_paracoord_plot
# Create 10x5 random array
values = np.random.random_sample((10, 5))
print(values)
# Plot parallel coordinates of those values
get_paracoord_plot(values)
# Set arbitrary labels for those 10 5-dimensional vectors
labels = ['aaa', 'bbb', 'aaa', 'ccc', 'bbb', 'aaa', 'aaa', 'bbb', 'aaa', 'ccc']
# Plot them in parallel coordinates with automatically chosen colors
get_paracoord_plot(values, labels=labels)
# Plot them with self defined color dict and save the resulting plot
color_dict = {'aaa': 'b', 'bbb': 'r', 'ccc': 'g'}
get_paracoord_plot(values, labels=labels, color_dict=color_dict, save_path='random_example.jpg', set_legend=True)
values: 2-dimensional numpy arraylabels: optional, array containing labels for each row ofvaluescolor_dict: dict, optional, ignored iflabelsnot provided. {label -> color} dict. Iflabelsis provided but notcolor_dict, the color of each label will be automatically chosensave_path: path to the file where the resulting image will be stored. If not provided, image will not be storedset_legend: boolean, optional, ignored iflabelsnot provided. If to set a color legend for the labels or notbox: boolean. If to set a frame (x-axis, y-axis etc.) for the resulting imageylims: (ymin, ymax). If not provided, will be set to the result toget_y_min_nax(values)
pip install paracoord
Enjoy, do whatever you want with it as long as you don't hold me responsible for the consequences :) Suggestions, remarks, critics, pull requests appreciated