yt.extensions.volume_rendering.ColorTransferFunction.add_layers

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

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 calculated as the logspace between -2.0 and 0.0.

colormap : string, optional

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

See also

ColorTransferFunction.sample_colormap
Single Gaussian adder

Examples

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

Previous topic

yt.extensions.volume_rendering.ColorTransferFunction.add_gaussian

Next topic

yt.extensions.volume_rendering.ColorTransferFunction.add_step

This Page