Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Plotly · Class

go.Parcoords

go.Parcoords creates an interactive parallel-coordinates trace for multidimensional exploratory analysis. Define variables in dimensions and control sample-path coloring through line.

How it works

Parcoords is a graph-object trace for multidimensional exploratory analysis. Supply one dimension definition per variable; each dimension contains aligned sample values, while the line settings control how sample paths are colored and filtered.

Syntax

plotly.graph_objects.Parcoords(arg=None, customdata=None, dimensions=None, id=None, ids=None, legend=None, legendgrouptitle=None, legendwidth=None, line=None, meta=None, name=None, opacity=None, selected=None, selectedpoints=None, showlegend=None, stream=None, text=None, uid=None, uirevision=None, unselected=None, visible=None, hoverinfo=None, hoverlabel=None, hovertemplate=None, zorder=None, **kwargs)

Parameters

NameTypeDescription
dimensionsarrayA list of dimension definitions describing the plotted variables and their sample values.
lineobjectTrace-level line styling and color configuration, including the color source and colorscale.
constraintrangearrayAn optional initial filtering interval or intervals for a dimension.

Returns

A plotly.graph_objects.Parcoords trace object.

Key points

  • Use this trace to inspect relationships among several numeric variables in one interactive view.
  • The dimensions collection is the main input for the observations and their axes.
  • Set line.color to distinguish sample paths, optionally with a colorscale for numeric values.
  • constraintrange limits the selectable region for a dimension.
  • Corresponding positions across dimension value arrays form complete observations, so their lengths should match.

Common mistakes

  • All dimensions should contain equally sized value vectors; longer vectors are truncated.
  • A single dimension filter range must be ordered from its lower bound to its upper bound.
  • Multiple filter intervals require enabling multiselect for that dimension.

Example: Basic parallel-coordinates chart

import plotly.graph_objects as go

fig = go.Figure(go.Parcoords(
    line=dict(color=[1, 2, 3], colorscale="Viridis"),
    dimensions=[
        dict(range=[0, 10], label="A", values=[1, 5, 9]),
        dict(range=[0, 10], label="B", values=[8, 4, 2]),
    ],
))
fig.show()

Creates a parallel-coordinates trace with two dimensions and colors each sample using a continuous colorscale.

When to use it

Multidimensional exploratory analysis

Exploring relationships across many numeric variables.

Color-coded sample comparison

Marking observations by a numeric category or score.

Interactive range filtering

Restricting displayed observations to selected value intervals.

Interview questions

QWhat is go.Parcoords used for?

Parcoords is a trace type used for parallel coordinates and is placed in a figure's data list. Its samples are provided through dimensions, and line.color controls their coloring.

Follow-up: How would you represent several variables? Add a dimension object for each variable, giving each a label and an aligned values array.

QHow do dimensions map data into the chart?

Each dimension describes one axis, commonly with range, label, and values. The values at the same index across dimensions describe one sample or line.

Follow-up: What constraint applies across dimensions? Their values vectors must have the same length; excess values are truncated.

QHow are dimension filters specified?

Use constraintrange to define the interval selected by a dimension filter. It accepts a two-value interval, or multiple intervals when multiselect is enabled.

Follow-up: What must be true of each interval? Its first value must not exceed its second value.

  • plotly.graph_objects.Figure
  • plotly.graph_objects.parcoords.Dimension
  • px.parallel_coordinates

Source: Python Figure Reference: parcoords Traces. Checked 2026-10-15.