Skip to content

Commit c3fbb64

Browse files
authored
Update doc/python/bar-charts.md
1 parent eca3711 commit c3fbb64

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: doc/python/bar-charts.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,7 @@ fig.show()
306306

307307
### Stacked Bar Chart From Aggregating a DataFrame
308308

309-
Stacked bar charts are a powerful way to present results summarizing categories generated using the Pandas aggregate commands. DF.agg() which produces a wide format data set with one row for each bar component and a column for each bar, which is the transpose of the orientation of the px.bar wide data frame. Tranposing and updating the indexes is a somewhat involved option. Here is one straightforward way to aggregate a data set into a summarized form and present the results as a stacked bar.
310-
309+
Stacked bar charts are a powerful way to present results summarizing categories generated using the Pandas aggregate commands. `pandas.DataFrame.agg` produces a wide data set format incompatible with `px.bar`. Transposing and updating the indexes to achieve `px.bar` compatibility is a somewhat involved option. Here is one straightforward alternative, which presents the aggregated data as a stacked bar using plotly.graph_objects.
311310
```
312311
313312
from plotly import graph_objects as go

0 commit comments

Comments
 (0)