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
Let's say we want the opacity to range from 0.5 to 1.0: dyn=(0.5, 1.0)
If clim[0] is a small number, smaller than _data.min()/2, then xtr_min will always be > 1.0. Then the subsequent call to alpha = normalize(_data, xtr_min, xtr_max) will always return 1.0 for every value.
I think the intended result can be achieved (at least for the 'ascending' case) with something a bit simpler: alpha = normalize(np.clip(_data, clim[0], clim[1]), dyn[0], dyn[1])
The text was updated successfully, but these errors were encountered:
docstring:
visbrain/visbrain/utils/color.py
Lines 656 to 657 in b2214ea
relevant code:
visbrain/visbrain/utils/color.py
Lines 685 to 686 in b2214ea
Let's say we want the opacity to range from 0.5 to 1.0:
dyn=(0.5, 1.0)
If
clim[0]
is a small number, smaller than_data.min()/2
, thenxtr_min
will always be > 1.0. Then the subsequent call toalpha = normalize(_data, xtr_min, xtr_max)
will always return 1.0 for every value.I think the intended result can be achieved (at least for the 'ascending' case) with something a bit simpler:
alpha = normalize(np.clip(_data, clim[0], clim[1]), dyn[0], dyn[1])
The text was updated successfully, but these errors were encountered: