Skip to content

Commit 507b25f

Browse files
committed
Update pie-charts.md
1 parent f578cbc commit 507b25f

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

doc/python/pie-charts.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.3'
9-
jupytext_version: 1.14.1
9+
jupytext_version: 1.14.6
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.8.8
23+
version: 3.10.11
2424
plotly:
2525
description: How to make Pie Charts.
2626
display_as: basic
@@ -300,6 +300,32 @@ fig.update_layout(title_text='World GDP')
300300
fig.show()
301301
```
302302

303+
### Pattern Fills
304+
305+
*New in 5.15*
306+
307+
Pie charts support [patterns](/python/pattern-hatching-texture/) (also known as hatching or texture) in addition to color.
308+
309+
```python
310+
import plotly.graph_objects as go
311+
312+
labels = ["Oxygen", "Hydrogen", "Carbon_Dioxide", "Nitrogen"]
313+
values = [4500, 2500, 1053, 500]
314+
colors = ["gold", "mediumturquoise", "darkorange", "lightgreen"]
315+
fig = go.Figure(
316+
data=[
317+
go.Pie(
318+
labels=labels,
319+
values=values,
320+
textfont_size=20,
321+
marker={"colors": colors, "pattern": {"shape": [".", "x", "+", "-"]}},
322+
)
323+
]
324+
)
325+
fig.show()
326+
327+
```
328+
303329
### See Also: Sunburst charts
304330

305331
For multilevel pie charts representing hierarchical data, you can use the `Sunburst` chart. A simple example is given below, for more information see the [tutorial on Sunburst charts](/python/sunburst-charts/).

0 commit comments

Comments
 (0)