Skip to content

Documentation for 5.10 features #3818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a8ae4ab
Update parallel-coordinates-plot.md
LiamConnors Jul 19, 2022
7f97ac2
Adding a prefix and suffix
LiamConnors Jul 19, 2022
7ff8954
Create selections.md
LiamConnors Jul 19, 2022
cfcf5f5
Update link
LiamConnors Jul 19, 2022
16880be
add methods to calculate quartiles
LiamConnors Jul 19, 2022
540d9d9
Update violin.md
LiamConnors Jul 19, 2022
600bf7a
Update setting-graph-size.md
LiamConnors Jul 19, 2022
11347f2
minor edits
LiamConnors Jul 19, 2022
15afc11
Update indicator.md
LiamConnors Jul 19, 2022
b47c824
Update indicator.md
LiamConnors Jul 19, 2022
e8d9959
minor edits
LiamConnors Jul 19, 2022
8741c88
Update setting-graph-size.md
LiamConnors Jul 19, 2022
5627314
Update doc/python/selections.md
LiamConnors Jul 21, 2022
ae737ac
Update doc/python/selections.md
LiamConnors Jul 21, 2022
b5fa284
Update parallel-coordinates-plot.md
LiamConnors Jul 21, 2022
c5bf5df
Update parallel-coordinates-plot.md
LiamConnors Jul 21, 2022
3682408
Update selections.md
LiamConnors Jul 21, 2022
e955334
Update selections.md
LiamConnors Jul 21, 2022
186dec4
Update doc/python/selections.md
LiamConnors Jul 21, 2022
6d1a2da
Update selections.md
LiamConnors Jul 21, 2022
e2eb238
add time series example
LiamConnors Jul 21, 2022
cb07e20
Update selections.md
LiamConnors Jul 21, 2022
0e536e9
Update selections.md
LiamConnors Jul 21, 2022
fbc1668
Update selections.md
LiamConnors Jul 21, 2022
a8c5649
Update doc/python/selections.md
LiamConnors Jul 22, 2022
263a9b8
add random seed
LiamConnors Jul 22, 2022
9e66af4
Update doc/python/selections.md
LiamConnors Jul 22, 2022
222b3b2
Update selections.md
LiamConnors Jul 22, 2022
b705619
Update doc/python/selections.md
LiamConnors Jul 22, 2022
1d753ed
Update selections.md
LiamConnors Jul 22, 2022
fa2f3f4
Update selections.md
LiamConnors Jul 22, 2022
c674802
Update selections.md
LiamConnors Jul 22, 2022
51e599e
Update selections.md
LiamConnors Jul 22, 2022
66443e1
Merge branch 'master' into docs-5-10
LiamConnors Jul 26, 2022
9417bcb
Update doc/python/selections.md
LiamConnors Jul 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions doc/python/box-plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jupyter:
text_representation:
extension: .md
format_name: markdown
format_version: '1.2'
jupytext_version: 1.4.2
format_version: '1.3'
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3
display_name: Python 3 (ipykernel)
language: python
name: python3
language_info:
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.7.7
version: 3.9.0
plotly:
description: How to make Box Plots in Python with Plotly.
display_as: statistical
Expand Down Expand Up @@ -90,7 +90,7 @@ fig.show()

### Choosing The Algorithm For Computing Quartiles

By default, quartiles for box plots are computed using the `linear` method (for more about linear interpolation, see #10 listed on [http://www.amstat.org/publications/jse/v14n3/langford.html](http://www.amstat.org/publications/jse/v14n3/langford.html) and [https://en.wikipedia.org/wiki/Quartile](https://en.wikipedia.org/wiki/Quartile) for more details).
By default, quartiles for box plots are computed using the `linear` method (for more about linear interpolation, see #10 listed on [http://jse.amstat.org/v14n3/langford.html](http://jse.amstat.org/v14n3/langford.html) and [https://en.wikipedia.org/wiki/Quartile](https://en.wikipedia.org/wiki/Quartile) for more details).

However, you can also choose to use an `exclusive` or an `inclusive` algorithm to compute quartiles.

Expand Down
35 changes: 31 additions & 4 deletions doc/python/indicator.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jupyter:
text_representation:
extension: .md
format_name: markdown
format_version: '1.1'
jupytext_version: 1.2.1
format_version: '1.3'
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3
display_name: Python 3 (ipykernel)
language: python
name: python3
language_info:
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.7.3
version: 3.9.0
plotly:
description: How to make gauge charts in Python with Plotly.
display_as: financial
Expand Down Expand Up @@ -61,6 +61,8 @@ In this tutorial we introduce a new trace named "Indicator". The purpose of "ind
<li> (increasing|decreasing).symbol: symbol displayed on the left of the delta</li>
<li> font.(family|size): to control the font</li>
<li> position: position relative to `number` (either top, left, bottom, right)</li>
<li> prefix: a string to appear before the delta
<li> suffix: a string to appear after the delta
</ol>
Finally, we can have a simple title for the indicator via `title` with 'text' attribute which is a string, and 'align' which can be set to left, center, and right.
There are two gauge types: [angular](https://plotly.com/python/gauge-charts/) and [bullet](https://plotly.com/python/bullet-charts/). Here is a combination of both shapes (angular, bullet), and different modes (gauge, delta, and value):
Expand Down Expand Up @@ -201,6 +203,31 @@ fig.add_trace(go.Indicator(
fig.show()
```

#### Adding a Prefix and Suffix


On both a `number` and a `delta`, you can add a string to appear before the value using `prefix`. You can add a string to appear after the value using `suffix`. In the following example, we add '$' as a `prefix` and 'm' as `suffix` for both the `number` and `delta`.

Note: `suffix` and `prefix` on `delta` are new in 5.10

```python
import plotly.graph_objects as go

fig = go.Figure(go.Indicator(
mode = "number+delta",
value = 492,
number = {"prefix": "$", "suffix": "m"},
delta = {"reference": 512, "valueformat": ".0f", "prefix": "$", "suffix": "m"},
title = {"text": "Profit"},
domain = {'y': [0, 1], 'x': [0.25, 0.75]}))

fig.add_trace(go.Scatter(
y = [325, 324, 405, 400, 424, 404, 417, 432, 419, 394, 410, 426, 413, 419, 404, 408, 401, 377, 368, 361, 356, 359, 375, 397, 394, 418, 437, 450, 430, 442, 424, 443, 420, 418, 423, 423, 426, 440, 437, 436, 447, 460, 478, 472, 450, 456, 436, 418, 429, 412, 429, 442, 464, 447, 434, 457, 474, 480, 499, 497, 480, 502, 512, 492]))

fig.update_layout(xaxis = {'range': [0, 62]})
fig.show()
```

#### Reference
See https://plotly.com/python/reference/indicator/ for more information and chart attribute options!

Expand Down
41 changes: 37 additions & 4 deletions doc/python/parallel-coordinates-plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ jupyter:
text_representation:
extension: .md
format_name: markdown
format_version: '1.1'
jupytext_version: 1.1.1
format_version: '1.3'
jupytext_version: 1.13.7
kernel_info:
name: python2
kernelspec:
display_name: Python 3
display_name: Python 3 (ipykernel)
language: python
name: python3
language_info:
Expand All @@ -22,7 +22,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.7.3
version: 3.9.0
plotly:
description: How to make parallel coordinates plots in Python with Plotly.
display_as: scientific
Expand Down Expand Up @@ -171,6 +171,39 @@ fig = go.Figure(data=
fig.show()
```

### Unselected Line Color and Opacity


*New in 5.10*

The color and opacity of unselected lines can be set with `unselected`. By setting `opacity=0`, you can hide the unselected lines. Here, we set the color to `lightgray` and the opacity to `0.5`.

```python
import plotly.graph_objects as go

fig = go.Figure(data=
go.Parcoords(
line_color='blue',
dimensions = list([
dict(range = [1,5],
constraintrange = [1,2], # change this range by dragging the pink line
label = 'A', values = [1,4]),
dict(range = [1.5,5],
tickvals = [1.5,3,4.5],
label = 'B', values = [3,1.5]),
dict(range = [1,5],
tickvals = [1,2,4,5],
label = 'C', values = [2,4],
ticktext = ['text 1', 'text 2', 'text 3', 'text 4']),
dict(range = [1,5],
label = 'D', values = [4,2])
]),
unselected = dict(line = dict(color = 'green', opacity = 0.5))
)
)
fig.show()
```

#### Reference

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!
Loading