Skip to content

Commit 325057d

Browse files
committed
add doc example for imshow binary_backend_kwargs
Signed-off-by: maximsmol <[email protected]>
1 parent 2706b2c commit 325057d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

doc/python/imshow.md

+13
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ fig = px.imshow(img, binary_format="jpeg", binary_compression_level=0)
7474
fig.show()
7575
```
7676

77+
```python
78+
import plotly.express as px
79+
from skimage import data
80+
img = data.astronaut()
81+
fig = px.imshow(
82+
img,
83+
# Pillow backend parameters are documented here: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#webp
84+
# Available parameters depend on the `binary_format`
85+
binary_backend_kwargs={"lossless": False}
86+
)
87+
fig.show()
88+
```
89+
7790
### Display single-channel 2D data as a heatmap
7891

7992
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/)).

0 commit comments

Comments
 (0)