Skip to content

Commit 767d6b1

Browse files
authored
pull example in pie chart (#1954)
1 parent 7ad066b commit 767d6b1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

doc/python/pie-charts.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jupyter:
3131
page_type: example_index
3232
permalink: python/pie-charts/
3333
thumbnail: thumbnail/pie-chart.jpg
34-
redirect_from: /python/pie/
3534
---
3635

3736
### Basic Pie Chart ###
@@ -80,6 +79,21 @@ fig = go.Figure(data=[go.Pie(labels=labels, values=values, hole=.3)])
8079
fig.show()
8180
```
8281

82+
### Pulling sectors out from the center
83+
84+
For a "pulled-out" or "exploded" layout of the pie chart, use the `pull` argument. It can be a scalar for pulling all sectors or an array to pull only some of the sectors.
85+
86+
```python
87+
import plotly.graph_objects as go
88+
89+
labels = ['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen']
90+
values = [4500, 2500, 1053, 500]
91+
92+
# pull is given as a fraction of the pie radius
93+
fig = go.Figure(data=[go.Pie(labels=labels, values=values, pull=[0, 0, 0.2, 0])])
94+
fig.show()
95+
```
96+
8397
### Pie Charts in subplots
8498

8599
```python

0 commit comments

Comments
 (0)