Skip to content

Commit a8ae4ab

Browse files
committed
Update parallel-coordinates-plot.md
Add example with unselected
1 parent 1f19f5f commit a8ae4ab

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

doc/python/parallel-coordinates-plot.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.1'
9-
jupytext_version: 1.1.1
8+
format_version: '1.3'
9+
jupytext_version: 1.13.7
1010
kernel_info:
1111
name: python2
1212
kernelspec:
13-
display_name: Python 3
13+
display_name: Python 3 (ipykernel)
1414
language: python
1515
name: python3
1616
language_info:
@@ -22,7 +22,7 @@ jupyter:
2222
name: python
2323
nbconvert_exporter: python
2424
pygments_lexer: ipython3
25-
version: 3.7.3
25+
version: 3.9.0
2626
plotly:
2727
description: How to make parallel coordinates plots in Python with Plotly.
2828
display_as: scientific
@@ -171,6 +171,39 @@ fig = go.Figure(data=
171171
fig.show()
172172
```
173173

174+
### Unselected Line Color and Opacity
175+
176+
177+
*New in 5.10*
178+
179+
The color and opacity of unselected lines can be set with `unselected`. Here, we set the color to `lightgray` and the opacity to `0.5`.
180+
181+
```python
182+
import plotly.graph_objects as go
183+
184+
fig = go.Figure(data=
185+
go.Parcoords(
186+
line_color='blue',
187+
dimensions = list([
188+
dict(range = [1,5],
189+
constraintrange = [1,2], # change this range by dragging the pink line
190+
label = 'A', values = [1,4]),
191+
dict(range = [1.5,5],
192+
tickvals = [1.5,3,4.5],
193+
label = 'B', values = [3,1.5]),
194+
dict(range = [1,5],
195+
tickvals = [1,2,4,5],
196+
label = 'C', values = [2,4],
197+
ticktext = ['text 1', 'text 2', 'text 3', 'text 4']),
198+
dict(range = [1,5],
199+
label = 'D', values = [4,2])
200+
]),
201+
unselected = dict(line = dict(color = 'lightgray', opacity = 0.5))
202+
)
203+
)
204+
fig.show()
205+
```
206+
174207
#### Reference
175208

176209
See [function reference for `px.(parallel_coordinates)`](https://plotly.com/python-api-reference/generated/plotly.express.parallel_coordinates) or https://plotly.com/python/reference/parcoords/ for more information and chart attribute options!

0 commit comments

Comments
 (0)