Parallel Plot using Pandas

logo of a chart:Parallel1

This post shows how to build a parallel plot using the pandas python library.

You can draw a parallel plot using pandas library of the python with the parallel_coordinates() function. In the example below, the following arguments are passed to the function:

  • data : data frame
  • class_column : column name containing class names
  • colormap : colormap to use for line colors
# libraries
import pandas
import matplotlib.pyplot as plt
import seaborn as sns
from pandas.plotting import parallel_coordinates
 
# Take the iris dataset
data = sns.load_dataset('iris')
 
# Make the plot
parallel_coordinates(data, 'species', colormap=plt.get_cmap("Set2"))
plt.show()

🚨 Grab the Data To Viz poster!


Do you know all the chart types? Do you know which one you should pick? I made a decision tree that answers those questions. You can download it for free!

    dataviz decision tree poster