yt.visualization.volume_rendering.transfer_functions.ColorTransferFunction.add_layers

ColorTransferFunction.add_layers(N, w=None, mi=None, ma=None, alpha=None, colormap='gist_stern', col_bounds=None)[source]

Add a set of Gaussians based on an existing colormap.

Constructing pleasing Gaussians in a transfer function can pose some challenges, so this function will add several evenly-spaced Gaussians whose colors are taken from a colormap scaled between the bounds of the transfer function. For each Gaussian to be added, ColorTransferFunction.sample_colormap is called.

Parameters:

N : int

How many Gaussians to add

w : float

The relative width of each Gaussian. If not included, it is calculated as 0.001 * (max_val - min_val) / N

mi : float, optional

If only a subset of the data range is to have the Gaussians added, this is the minimum for that subset

ma : float, optional

If only a subset of the data range is to have the Gaussians added, this is the maximum for that subset

alpha : list of floats, optional

The alpha value height for each Gaussian. If not supplied, it is set as 1.0 everywhere.

colormap : string, optional

An acceptable colormap. See either yt.visualization.color_maps or http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps .

col_bounds: array_like [min, max], optional :

Limits the values over which the colormap spans to these values. Useful for sampling an entire colormap over a range smaller than the transfer function bounds.

See also

ColorTransferFunction.sample_colormap
Single Gaussian adder

Examples

>>> tf = ColorTransferFunction( (-10.0, -5.0) )
>>> tf.add_layers(8)