8000 Documentation for 5.10 features by LiamConnors · Pull Request #3818 · plotly/plotly.py · GitHub
[go: up one dir, main page]

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
Changes from 1 commit
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 exa 8000 mple
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
Prev Previous commit
Next Next commit
add methods to calculate quartiles
  • Loading branch information
LiamConnors committed Jul 19, 2022
commit 16880be8d2e514b7276c101bfaf8276bbd00cec2
28 changes: 24 additions & 4 deletions doc/python/violin.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 violin plots in Python with Plotly.
display_as: statistical
Expand Down Expand Up @@ -274,6 +274,26 @@ fig = px.strip(df, x='day', y='tip')
fig.show()
```

### Choosing The Algorithm For Computing Quartiles

By default, quartiles for violin 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).

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

The _exclusive_ algorithm uses the median to divide the ordered dataset into two halves. If the sample is odd, it does not include the median in either half. Q1 is then the median of the lower half and Q3 is the median of the upper half.

The _inclusive_ algorithm also uses the median to divide the ordered dataset into two halves, but if the sample is odd, it includes the median in both halves. Q1 is then the median of the lower half and Q3 the median of the upper half.

```python
import plotly.express as px

df = px.data.tips()
fig = px.violin(df, y="total_bill")
fig.update_traces(quartilemethod="exclusive") # or "inclusive", or "linear" by default

fig.show()
```

#### Reference

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