File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
packages/python/plotly/plotly Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -189,10 +189,10 @@ def imshow(
189
189
represented as grayscale and with no colorbar if use_binary_string is
190
190
True.
191
191
192
- contrast_rescaling: 'image ', 'dtype ', or None
192
+ contrast_rescaling: 'minmax ', 'infer ', or None
193
193
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
196
196
data type is used.
197
197
198
198
Returns
@@ -291,9 +291,9 @@ def imshow(
291
291
zmin = range_color [0 ]
292
292
zmax = range_color [1 ]
293
293
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 "
295
295
296
- if contrast_rescaling == "image " :
296
+ if contrast_rescaling == "minmax " :
297
297
if (zmin is not None or use_binary_string ) and zmax is None :
298
298
zmax = img .max ()
299
299
if (zmax is not None or use_binary_string ) and zmin is None :
Original file line number Diff line number Diff line change @@ -223,11 +223,11 @@ def test_imshow_source():
223
223
np .float64 ,
224
224
],
225
225
)
226
- @pytest .mark .parametrize ("contrast_rescaling" , ["image " , "dtype " ])
226
+ @pytest .mark .parametrize ("contrast_rescaling" , ["minmax " , "infer " ])
227
227
def test_imshow_source_dtype_zmax (dtype , contrast_rescaling ):
228
228
img = np .arange (100 , dtype = dtype ).reshape ((10 , 10 ))
229
229
fig = px .imshow (img , use_binary_string = True , contrast_rescaling = contrast_rescaling )
230
- if contrast_rescaling == "image " :
230
+ if contrast_rescaling == "minmax " :
231
231
assert (
232
232
np .max (
233
233
np .abs (
You can’t perform that action at this time.
0 commit comments