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/heatmaps.md
+23-4Lines changed: 23 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,8 @@ jupyter:
5
5
text_representation:
6
6
extension: .md
7
7
format_name: markdown
8
-
format_version: '1.1'
9
-
jupytext_version: 1.1.1
8
+
format_version: '1.2'
9
+
jupytext_version: 1.3.0
10
10
kernelspec:
11
11
display_name: Python 3
12
12
language: python
@@ -20,7 +20,7 @@ jupyter:
20
20
name: python
21
21
nbconvert_exporter: python
22
22
pygments_lexer: ipython3
23
-
version: 3.6.7
23
+
version: 3.7.3
24
24
plotly:
25
25
description: How to make Heatmaps in Python with Plotly.
26
26
display_as: scientific
@@ -34,7 +34,26 @@ jupyter:
34
34
thumbnail: thumbnail/heatmap.jpg
35
35
---
36
36
37
-
### Basic Heatmap
37
+
### Heatmap with `plotly.express` and `px.imshow`
38
+
39
+
[Plotly Express](/python/plotly-express/) is the easy-to-use, high-level interface to Plotly. With `px.imshow`, each value of the input array is represented as a heatmap pixel.
40
+
41
+
`px.imshow` makes opiniated choices for representing heatmaps, such as using square pixels. To override this behaviour, you can use `fig.update_layout` or use the `go.Heatmap` trace from `plotly.graph_objects` as described below.
42
+
43
+
For more examples using `px.imshow`, see the [tutorial on displaying image data with plotly](/python/imshow).
44
+
45
+
```python
46
+
import plotly.express as px
47
+
48
+
fig = px.imshow([[1, 20, 30],
49
+
[20, 1, 60],
50
+
[30, 60, 1]])
51
+
fig.show()
52
+
```
53
+
54
+
### Basic Heatmap with `plotly.graph_objects`
55
+
56
+
If Plotly Express does not provide a good starting point, it is also possible to use the more generic `go.Heatmap` function from `plotly.graph_objects`.
0 commit comments