ColorTransferFunction.
map_to_colormap
(mi, ma, scale=1.0, colormap='gist_stern', scale_func=None)[source]¶Map a range of values to a full colormap.
Given a minimum and maximum value in the TransferFunction, map a full colormap over that range at an alpha level of scale. Optionally specify a scale_func function that modifies the alpha as a function of the transfer function value.
Parameters: | mi : float
ma : float
scale: float, optional :
colormap : string, optional
scale_func: function(value, minval, maxval), optional :
|
---|
Examples
>>> def linramp(vals, minval, maxval):
... return (vals - vals.min())/(vals.(max) - vals.min())
>>> tf = ColorTransferFunction( (-10.0, -5.0) )
>>> tf.map_to_colormap(-8.0, -6.0, scale=10.0, colormap='algae')
>>> tf.map_to_colormap(-6.0, -5.0, scale=10.0, colormap='algae',
... scale_func = linramp)