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/imshow.md
+91-2
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ jupyter:
6
6
extension: .md
7
7
format_name: markdown
8
8
format_version: '1.2'
9
-
jupytext_version: 1.4.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.7.7
23
+
version: 3.7.3
24
24
plotly:
25
25
description: How to display image data in Python with Plotly.
26
26
display_as: scientific
@@ -399,6 +399,95 @@ for compression_level in range(0, 9):
399
399
fig.show()
400
400
```
401
401
402
+
### Exploring 3-D images, timeseries and sequences of images with `facet_col`
403
+
404
+
*Introduced in plotly 4.14*
405
+
406
+
For three-dimensional image datasets, obtained for example by MRI or CT in medical imaging, one can explore the dataset by representing its different planes as facets. The `facet_col` argument specifies along which axis the image is sliced through to make the facets. With `facet_col_wrap`, one can set the maximum number of columns. For image datasets passed as xarrays, it is also possible to specify the axis by its name (label), thus passing a string to `facet_col`.
407
+
408
+
It is recommended to use `binary_string=True` for facetted plots of images in order to keep a small figure size and a short rendering time.
409
+
410
+
See the [tutorial on facet plots](/python/facet-plots/) for more information on creating and styling facet plots.
Facets can also be used to represent several images of equal shape, like in the example below where different values of the blurring parameter of a Gaussian filter are compared.
424
+
425
+
```python
426
+
import plotly.express as px
427
+
import numpy as np
428
+
from skimage import data, filters, img_as_float
429
+
img = data.camera()
430
+
sigmas = [1, 2, 4]
431
+
img_sequence = [filters.gaussian(img, sigma=sigma) for sigma in sigmas]
### Exploring 3-D images and timeseries with `animation_frame`
445
+
446
+
*Introduced in plotly 4.14*
447
+
448
+
For three-dimensional image datasets, obtained for example by MRI or CT in medical imaging, one can explore the dataset by sliding through its different planes in an animation. The `animation_frame` argument of `px.imshow` sets the axis along which the 3-D image is sliced in the animation.
For xarray datasets, one can pass either an axis number or an axis name to `animation_frame`. Axis names and coordinates are automatically used for the labels, ticks and animation controls of the figure.
466
+
467
+
```python
468
+
import plotly.express as px
469
+
import xarray as xr
470
+
# Load xarray from dataset included in the xarray tutorial
See [function reference for `px.(imshow)`](https://plotly.com/python-api-reference/generated/plotly.express.imshow) or https://plotly.com/python/reference/image/ for more information and chart attribute options!
0 commit comments