You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/python/2D-Histogram.md
+23-4Lines changed: 23 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,10 @@ jupyter:
5
5
text_representation:
6
6
extension: .md
7
7
format_name: markdown
8
-
format_version: '1.2'
9
-
jupytext_version: 1.3.1
8
+
format_version: '1.3'
9
+
jupytext_version: 1.13.2
10
10
kernelspec:
11
-
display_name: Python 3
11
+
display_name: Python 3 (ipykernel)
12
12
language: python
13
13
name: python3
14
14
language_info:
@@ -20,7 +20,7 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.6.8
23
+
version: 3.7.0
24
24
plotly:
25
25
description: How to make 2D Histograms in Python with Plotly.
26
26
display_as: statistical
@@ -235,5 +235,24 @@ fig.update_layout(
235
235
fig.show()
236
236
```
237
237
238
+
### Adding text to points
239
+
240
+
241
+
In this example we show how to add text to 2D-Histogram points. We use the values from the `z` attribute for the text, and add them using the format **%{variable}**.
242
+
243
+
```python
244
+
import plotly.graph_objects as go
245
+
from plotly import data
246
+
247
+
df = data.tips()
248
+
249
+
fig = go.Figure(go.Histogram2d(
250
+
x=df.total_bill,
251
+
y=df.tip,
252
+
texttemplate="%{z}"
253
+
))
254
+
fig.show()
255
+
```
256
+
238
257
#### Reference
239
258
See https://plotly.com/python/reference/histogram2d/ for more information and chart attribute options!
Copy file name to clipboardExpand all lines: doc/python/heatmaps.md
+23-4Lines changed: 23 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,10 @@ jupyter:
5
5
text_representation:
6
6
extension: .md
7
7
format_name: markdown
8
-
format_version: '1.2'
9
-
jupytext_version: 1.6.0
8
+
format_version: '1.3'
9
+
jupytext_version: 1.13.2
10
10
kernelspec:
11
-
display_name: Python 3
11
+
display_name: Python 3 (ipykernel)
12
12
language: python
13
13
name: python3
14
14
language_info:
@@ -20,7 +20,7 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.7.6
23
+
version: 3.7.0
24
24
plotly:
25
25
description: How to make Heatmaps in Python with Plotly.
26
26
display_as: scientific
@@ -197,6 +197,25 @@ fig.update_layout(
197
197
fig.show()
198
198
```
199
199
200
+
### Adding text to points
201
+
202
+
203
+
In this example we show how to add text to heatmap points. We use the values from the `text` attribute for the text, and add them using the format **%{variable}**.
204
+
205
+
```python
206
+
import plotly.graph_objects as go
207
+
208
+
fig = go.Figure(data=go.Heatmap(
209
+
z=[[1, 20, 30],
210
+
[20, 1, 60],
211
+
[30, 60, 1]],
212
+
text=[['one', 'twenty', 'thirty'],
213
+
['twenty', 'one', 'sixty'],
214
+
['thirty', 'sixty', 'one']],
215
+
texttemplate="%{text}"))
216
+
fig.show()
217
+
```
218
+
200
219
### Heatmap and datashader
201
220
202
221
Arrays of rasterized values build by datashader can be visualized using
0 commit comments