def sequential_colormap(x):
from numpy import array
from scipy.special import erf
x = array(x)
if any(x < 0) or any(x > 1):
raise ValueError('x must be between 0 and 1 inclusive.')
red = 1.000 - 0.392 * (1 + erf((x - 0.869) / 0.255))
grn = 1.021 - 0.456 * (1 + erf((x - 0.527) / 0.376))
blu = 1.000 - 0.493 * (1 + erf((x - 0.272) / 0.309))
return array([red, grn, blu]).T
评论列表
文章目录