Python:Plotly .Parcoords()
Anonymous contributor
Published Mar 24, 2025
Contribute to Docs
In Plotly, the .Parcoords() function under the graph_objects module creates a parallel coordinates plot representing multivariate data. Each row of the given dataset is plotted as a polyline between the parallel axes.
Syntax
plotly.graph_objects.Parcoords(line=None, dimensions=None, ...)
line: A dictionary of class properties to be used.dimensions: A list of dictionaries with class properties to be used.
Note: The ellipsis (…) in the syntax indicates that there are additional optional parameters beyond those listed here to customize the parcoords plot.
Example
This code creates a parallel coordinates plot using the .Parcoords() function:
import plotly.graph_objects as goimport plotly.express as pximport pandas as pd# Load the Iris datasetdf = px.data.iris()# Create a parallel coordinates plotfig = go.Figure(data=go.Parcoords(line = dict(color = df['species_id'],colorscale = [[0, 'gold'], [0.5, 'teal'], [1.0, 'purple']]),dimensions = list((dict(range = [0,8],constraintrange = [4,8],label = 'Sepal Length', values = df['sepal_length']),dict(range = [0,8],label = 'Sepal Width', values = df['sepal_width']),dict(range = [0,8],label = 'Petal Length', values = df['petal_length']),dict(range = [0,8],label = 'Petal Width', values = df['petal_width'])))))# Display the plotfig.show()
In the above code, the data in the DataFrame can be accessed through the dimensions class and the lines of the parallel coordinates plot can be adjusted with the line class properties.
The above code generates the following output:

All contributors
- Anonymous contributor
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Python:Plotly on Codecademy
- Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
- Includes 6 Courses
- With Professional Certification
- Beginner Friendly.75 hours
- Learn the basics of Python 3.12, one of the most powerful, versatile, and in-demand programming languages today.
- With Certificate
- Beginner Friendly.24 hours