Skip to content

Commit b689a2f

Browse files
committed
attempt to use imshow with binary strings and xarrays
1 parent 7a3a9f4 commit b689a2f

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

packages/python/plotly/plotly/express/_imshow.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,12 @@ def imshow(
301301
fig = init_figure(args, "xy", [], nrows, ncols, col_labels, [])
302302
# ----- Define x and y, set labels if img is an xarray -------------------
303303
if xarray_imported and isinstance(img, xarray.DataArray):
304-
if binary_string:
305-
raise ValueError(
306-
"It is not possible to use binary image strings for xarrays."
307-
"Please pass your data as a numpy array instead using"
308-
"`img.values`"
309-
)
304+
# if binary_string:
305+
# raise ValueError(
306+
# "It is not possible to use binary image strings for xarrays."
307+
# "Please pass your data as a numpy array instead using"
308+
# "`img.values`"
309+
# )
310310
y_label, x_label = img.dims[0], img.dims[1]
311311
# np.datetime64 is not handled correctly by go.Heatmap
312312
for ax in [x_label, y_label]:
@@ -506,7 +506,10 @@ def imshow(
506506
else:
507507
raise ValueError(
508508
"px.imshow only accepts 2D single-channel, RGB or RGBA images. "
509-
"An image of shape %s was provided" % str(img.shape)
509+
"An image of shape %s was provided"
510+
"Alternatively, 3-D single or multichannel datasets can be"
511+
"visualized using the `facet_col` or `animation_frame` arguments."
512+
% str(img.shape)
510513
)
511514

512515
layout_patch = dict()

0 commit comments

Comments
 (0)