Parcoords
Overview
The parcoords
trace type is used to create parallel coordinates plots, which are useful for visualizing multi-dimensional numerical data. In parallel coordinates plots, each variable is represented as a vertical axis, and each data point is a line connecting its values across the different axes.
You can customize the axis scaling, color mapping, and line properties to represent your data effectively.
Common Uses
- Multivariate Data Analysis: Visualizing relationships between multiple variables.
- Data Exploration: Exploring patterns and outliers in high-dimensional datasets.
- Decision Making: Identifying optimal points or anomalies in multi-variable data.
Check out the Attributes for the full set of configuration options
Examples
Common Configurations
Here's a simple parcoords
plot visualizing three numerical variables:
You can copy this code below to create this chart in your project:
models:
- name: parcoords-data
args:
- echo
- |
variable_1,variable_2,variable_3
1,4,7
2,5,8
3,6,9
traces:
- name: Simple Parcoords Plot
model: ${ref(parcoords-data)}
props:
type: parcoords
dimensions:
- label: "Variable 1"
values: ?{variable_1}
- label: "Variable 2"
values: ?{variable_2}
- label: "Variable 3"
values: ?{variable_3}
line:
color: ?{variable_3}
colorscale: "Viridis"
charts:
- name: Simple Parcoords Chart
traces:
- ${ref(Simple Parcoords Plot)}
layout:
title:
text: Simple Parcoords Plot<br><sub>Parallel Coordinates with Three Variables</sub>
This example demonstrates a parcoords
plot with custom axis ranges, allowing you to focus on specific data ranges:
Here's the code:
models:
- name: parcoords-data-ranges
args:
- echo
- |
variable_1,variable_2,variable_3
5,10,15
10,20,25
15,30,35
traces:
- name: Parcoords Plot with Custom Ranges
model: ${ref(parcoords-data-ranges)}
props:
type: parcoords
dimensions:
- label: "Variable 1"
values: ?{variable_1}
range: [5, 15]
- label: "Variable 2"
values: ?{variable_2}
range: [10, 30]
- label: "Variable 3"
values: ?{variable_3}
range: [15, 35]
line:
color: ?{variable_3}
colorscale: "Blues"
charts:
- name: Parcoords Chart with Custom Ranges
traces:
- ${ref(Parcoords Plot with Custom Ranges)}
layout:
title:
text: Parcoords Plot with Custom Ranges<br><sub>Custom Ranges for Each Variable</sub>
Here's a parcoords
plot with a custom colorscale for the lines, highlighting the variations across the third variable:
Here's the code:
models:
- name: parcoords-data-colorscale
args:
- echo
- |
variable_1,variable_2,variable_3
1,2,3
2,3,4
3,4,5
traces:
- name: Parcoords Plot with Custom Colorscale
model: ${ref(parcoords-data-colorscale)}
props:
type: parcoords
dimensions:
- label: "Variable 1"
values: ?{variable_1}
- label: "Variable 2"
values: ?{variable_2}
- label: "Variable 3"
values: ?{variable_3}
line:
color: ?{variable_3}
colorscale: "Jet"
charts:
- name: Parcoords Chart with Custom Colorscale
traces:
- ${ref(Parcoords Plot with Custom Colorscale)}
layout:
title:
text: Parcoords Plot with Custom Colorscale<br><sub>Custom Colors for Line Based on Variable 3</sub>
A schema to validate plotly trace properties
Attributes
These attributes apply to traces where trace.props.type
is set to parcoords
. You would configure these attributes on the trace with the trace.props
object.
customdata: array
customdatasrc: 'string' #(1)!
dimensions: array
domain:
column: integer
row: integer
x: array
y: array
ids: array
idssrc: 'string' #(2)!
labelangle: number
labelfont:
color: any
family: 'string' #(3)!
lineposition: any
shadow: 'string' #(4)!
size: number
style: any
textcase: any
variant: any
weight: integer
labelside: any
legend: string
legendgrouptitle:
font:
color: any
family: 'string' #(5)!
lineposition: any
shadow: 'string' #(6)!
size: number
style: any
textcase: any
variant: any
weight: integer
text: 'string' #(7)!
legendrank: number
legendwidth: number
line:
autocolorscale: boolean
cauto: boolean
cmax: number
cmid: number
cmin: number
color: array
coloraxis: string
colorbar:
bgcolor: any
bordercolor: any
borderwidth: number
exponentformat: any
len: number
lenmode: any
minexponent: number
nticks: integer
orientation: any
outlinecolor: any
outlinewidth: number
separatethousands: boolean
showexponent: any
showticklabels: boolean
showtickprefix: any
showticksuffix: any
thickness: number
thicknessmode: any
tickangle: number
tickcolor: any
tickfont:
color: any
family: 'string' #(8)!
lineposition: any
shadow: 'string' #(9)!
size: number
style: any
textcase: any
variant: any
weight: integer
tickformat: 'string' #(10)!
tickformatstops: array
ticklabeloverflow: any
ticklabelposition: any
ticklabelstep: integer
ticklen: number
tickmode: any
tickprefix: 'string' #(11)!
ticks: any
ticksuffix: 'string' #(12)!
ticktext: array
ticktextsrc: 'string' #(13)!
tickvals: array
tickvalssrc: 'string' #(14)!
tickwidth: number
title:
font:
color: any
family: 'string' #(15)!
lineposition: any
shadow: 'string' #(16)!
size: number
style: any
textcase: any
variant: any
weight: integer
side: any
text: 'string' #(17)!
x: number
xanchor: any
xpad: number
xref: any
y: number
yanchor: any
ypad: number
yref: any
colorscale: any
colorsrc: 'string' #(18)!
reversescale: boolean
showscale: boolean
metasrc: 'string' #(19)!
name: 'string' #(20)!
rangefont:
color: any
family: 'string' #(21)!
lineposition: any
shadow: 'string' #(22)!
size: number
style: any
textcase: any
variant: any
weight: integer
stream:
maxpoints: number
token: 'string' #(23)!
tickfont:
color: any
family: 'string' #(24)!
lineposition: any
shadow: 'string' #(25)!
size: number
style: any
textcase: any
variant: any
weight: integer
type: parcoords
uid: 'string' #(26)!
unselected:
line:
color: any
opacity: number
visible: any
- Sets the source reference on Chart Studio Cloud for
customdata
. - Sets the source reference on Chart Studio Cloud for
ids
. - HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- Sets the title of the legend group.
- HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: %h for half of the year as a decimal number as well as %{n}f for fractional seconds with n digits. For example, 2016-10-13 09:15:23.456 with tickformat %H~%M~%S.%2f would display 09~15~23.46
- Sets a tick label prefix.
- Sets a tick label suffix.
- Sets the source reference on Chart Studio Cloud for
ticktext
. - Sets the source reference on Chart Studio Cloud for
tickvals
. - HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- Sets the title of the color bar.
- Sets the source reference on Chart Studio Cloud for
color
. - Sets the source reference on Chart Studio Cloud for
meta
. - Sets the trace name. The trace name appears as the legend item and on hover.
- HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details.
- HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.