Parallel Coordinates plotting
Project description
paracoord: Plot 2-dimensional arrays in Parallel coordinates
Purpose
This package is an attempt to implement the idea of parallel coordinates from Sébastien Tricaud and Philippe Saadé to general purposes.
Example
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)
Options
values
: 2-dimensional numpy arraylabels
: optional, array containing labels for each row ofvalues
color_dict
: dict, optional, ignored iflabels
not provided. {label -> color} dict. Iflabels
is 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 iflabels
not 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)
Installation
pip install paracoord
Final note
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
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
paracoord-0.3.tar.gz
(3.5 kB
view hashes)