MCPcopy Index your code
hub / github.com/plotly/plotly.py / _vectorize_zvalue

Function _vectorize_zvalue

plotly/express/_imshow.py:20–36  ·  view source on GitHub ↗
(z, mode="max")

Source from the content-addressed store, hash-verified

18
19
20def _vectorize_zvalue(z, mode="max"):
21 alpha = 255 if mode == "max" else 0
22 if z is None:
23 return z
24 elif np.isscalar(z):
25 return [z] * 3 + [alpha]
26 elif len(z) == 1:
27 return list(z) * 3 + [alpha]
28 elif len(z) == 3:
29 return list(z) + [alpha]
30 elif len(z) == 4:
31 return z
32 else:
33 raise ValueError(
34 "zmax can be a scalar, or an iterable of length 1, 3 or 4. "
35 "A value of %s was passed for zmax." % str(z)
36 )
37
38
39def _infer_zmax_from_type(img):

Callers 1

imshowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected