Skip to content

Commit 01195f8

Browse files
committed
values for contrast_rescaling are now minmax and infer
1 parent febdfaf commit 01195f8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,10 @@ def imshow(
189189
represented as grayscale and with no colorbar if use_binary_string is
190190
True.
191191
192-
contrast_rescaling: 'image', 'dtype', or None
192+
contrast_rescaling: 'minmax', 'infer', or None
193193
how to determine data values corresponding to the bounds of the color
194-
range, when zmin or zmax are not passed. If `image`, the min and max
195-
values of the image are used. If `dtype`, a heuristic based on the image
194+
range, when zmin or zmax are not passed. If `minmax`, the min and max
195+
values of the image are used. If `infer`, a heuristic based on the image
196196
data type is used.
197197
198198
Returns
@@ -291,9 +291,9 @@ def imshow(
291291
zmin = range_color[0]
292292
zmax = range_color[1]
293293
if contrast_rescaling is None:
294-
contrast_rescaling = "image" if img.ndim == 2 else "dtype"
294+
contrast_rescaling = "minmax" if img.ndim == 2 else "infer"
295295

296-
if contrast_rescaling == "image":
296+
if contrast_rescaling == "minmax":
297297
if (zmin is not None or use_binary_string) and zmax is None:
298298
zmax = img.max()
299299
if (zmax is not None or use_binary_string) and zmin is None:

packages/python/plotly/plotly/tests/test_core/test_px/test_imshow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,11 @@ def test_imshow_source():
223223
np.float64,
224224
],
225225
)
226-
@pytest.mark.parametrize("contrast_rescaling", ["image", "dtype"])
226+
@pytest.mark.parametrize("contrast_rescaling", ["minmax", "infer"])
227227
def test_imshow_source_dtype_zmax(dtype, contrast_rescaling):
228228
img = np.arange(100, dtype=dtype).reshape((10, 10))
229229
fig = px.imshow(img, use_binary_string=True, contrast_rescaling=contrast_rescaling)
230-
if contrast_rescaling == "image":
230+
if contrast_rescaling == "minmax":
231231
assert (
232232
np.max(
233233
np.abs(

0 commit comments

Comments
 (0)