Skip to content

Commit 7570bbf

Browse files
committed
Update treemaps.md
1 parent 253fa4e commit 7570bbf

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

Diff for: doc/python/treemaps.md

+24-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ 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:
1111
display_name: Python 3 (ipykernel)
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.8.0
23+
version: 3.10.11
2424
plotly:
2525
description: How to make Treemap Charts with Plotly
2626
display_as: basic
@@ -423,6 +423,28 @@ fig.update_layout(
423423
fig.show()
424424
```
425425

426+
### Pattern Fills
427+
428+
*New in 5.15*
429+
430+
Treemap charts support [patterns](/python/pattern-hatching-texture/) (also known as hatching or texture) in addition to color. In this example, we apply a pattern to the root node.
431+
432+
```python
433+
import plotly.graph_objects as go
434+
435+
fig = go.Figure(go.Treemap(
436+
labels = ["Eve","Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
437+
parents = ["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"],
438+
root_color="lightgrey",
439+
textfont_size=20,
440+
marker=dict(
441+
pattern=dict(shape=["|"], solidity=0.80)
442+
)
443+
))
444+
445+
fig.show()
446+
```
447+
426448
#### Reference
427449

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

0 commit comments

Comments
 (0)