You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/python/histograms.md
+19-4Lines changed: 19 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.7.3
23
+
version: 3.8.5
24
24
plotly:
25
25
description: How to make Histograms in Python with Plotly.
26
26
display_as: statistical
@@ -30,9 +30,9 @@ jupyter:
30
30
order: 3
31
31
page_type: example_index
32
32
permalink: python/histograms/
33
-
redirect_from:
34
-
- /python/histogram-tutorial/
35
-
- /python/histogram/
33
+
redirect_from:
34
+
- /python/histogram-tutorial/
35
+
- /python/histogram/
36
36
thumbnail: thumbnail/histogram.jpg
37
37
---
38
38
@@ -392,6 +392,21 @@ fig.update_layout(
392
392
fig.show()
393
393
```
394
394
395
+
### Sort Histogram by Category Order
396
+
397
+
Histogram bars can also be sorted based on the ordering logic of the categorical values using the [categoryorder](https://plotly.com/python/reference/layout/xaxis/#layout-xaxis-categoryorder) attribute of the x-axis. Sorting of histogram bars using `categoryorder` also works with multiple traces on the same x-axis. In the following examples, the histogram bars are sorted based on the total numerical values.
0 commit comments