Skip to content

Commit 7a62e5c

Browse files
committed
Heatmap text example
1 parent 5c00b07 commit 7a62e5c

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

doc/python/heatmaps.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.2'
9-
jupytext_version: 1.6.0
8+
format_version: '1.3'
9+
jupytext_version: 1.13.4
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.7.6
23+
version: 3.7.11
2424
plotly:
2525
description: How to make Heatmaps in Python with Plotly.
2626
display_as: scientific
@@ -197,6 +197,25 @@ fig.update_layout(
197197
fig.show()
198198
```
199199

200+
### Text on Heatmap Points
201+
202+
203+
In this example we add text to heatmap points. We use the values from the `text` attribute for the text.
204+
205+
```python
206+
import plotly.graph_objects as go
207+
from plotly import data
208+
209+
df = data.tips()
210+
211+
fig = go.Figure(go.Histogram2d(
212+
x=df.total_bill,
213+
y=df.tip,
214+
texttemplate= "%{z}"
215+
))
216+
fig.show()
217+
```
218+
200219
### Heatmap and datashader
201220

202221
Arrays of rasterized values build by datashader can be visualized using

0 commit comments

Comments
 (0)