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: python/imshow.md
+5-6
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,6 @@ jupyter:
32
32
order: 3
33
33
page_type: example_index
34
34
permalink: python/imshow/
35
-
redirect_from: python/imshow/
36
35
thumbnail: thumbnail/imshow.jpg
37
36
v4upgrade: true
38
37
---
@@ -77,7 +76,7 @@ fig.show()
77
76
78
77
### Display single-channel 2D image as grayscale
79
78
80
-
For a 2D image, `px.imshow` uses a colorscale to map scalar data to colors. The default colorscale is the one of the active template (see [the tutorial on templates](/python/templates/)).
79
+
For a 2D image, `px.imshow` uses a colorscale to map scalar data to colors. The default colorscale is the one of the active template (see [the tutorial on templates](/python/templates/)).
81
80
82
81
```python
83
82
import plotly.express as px
@@ -102,7 +101,7 @@ fig.show()
102
101
103
102
It is also possible to use the `go.Image` trace from the low-level `graph_objects` API in order to display image data. Note that `go.Image` only accepts multichannel images. For single images, use [`go.Heatmap`](/python/heatmaps).
104
103
105
-
Note that the `go.Image` trace is different from the `go.layout.Image` class, which can be used for [adding background images or logos to figures](/python/images).
104
+
Note that the `go.Image` trace is different from the `go.layout.Image` class, which can be used for [adding background images or logos to figures](/python/images).
106
105
107
106
```python
108
107
import plotly.graph_objects as go
@@ -114,7 +113,7 @@ fig.show()
114
113
115
114
### Defining the data range covered by the color range with zmin and zmax
116
115
117
-
The data range and color range are mapped together using the parameters `zmin` and `zmax`, which correspond respectively to the data values mapped to black `[0, 0, 0]` and white `[255, 255, 255]`, or to the extreme colors of the colorscale in the case on single-channel data.
116
+
The data range and color range are mapped together using the parameters `zmin` and `zmax`, which correspond respectively to the data values mapped to black `[0, 0, 0]` and white `[255, 255, 255]`, or to the extreme colors of the colorscale in the case on single-channel data.
118
117
119
118
For single-channel data, the defaults values of `zmin` and `zmax` used by `px.imshow` and `go.Heatmap` are the extrema of the data range. For multichannel data, `px.imshow` and `go.Image` use slightly different default values for `zmin` and `zmax`. For `go.Image`, the default value is `zmin=[0, 0, 0]` and `zmax=[255, 255, 255]`, no matter the data type. On the other hand, `px.imshow` adapts the default `zmin` and `zmax` to the data type:
120
119
- for integer data types, `zmin` and `zmax` correspond to the extreme values of the data type, for example 0 and 255 for `uint8`, 0 and 65535 for `uint16`, etc.
@@ -163,7 +162,7 @@ import plotly.graph_objects as go
0 commit comments