Module ImportFrom alias ImportFrom alias Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias Assign NameStore ListLoad Str Str Str Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad kwarg body If UnaryOpNot Call NameLoad NameLoad Str body Assign NameStore Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num Num Call NameLoad SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad GeneratorExp TupleLoad NameLoad ListComp TupleLoad NameLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Call NameLoad NameLoad Assign NameStore TupleLoad Str Str Str Str Return Call NameLoad GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad decorator_list Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str If Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad Num Num If CompareIs NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index Num If CompareIs NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index Num Assert CompareLtELtE Num NameLoad Num Assert CompareLtELtE Num NameLoad Num Assign TupleStore NameStore NameStore NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assert CompareLtELtE NameLoad NameLoad NameLoad Assign NameStore BinOpDiv BinOpMult BinOpSub NameLoad NameLoad Call NameLoad BinOpSub NameLoad NameLoad BinOpSub NameLoad NameLoad Assign NameStore BinOpAdd NameLoad NameLoad Return Call NameLoad NameLoad decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str If Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad Num Num If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Num NameLoad If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Num NameLoad Assert CompareLtELtE Num SubscriptLoad NameLoad Index Num Num Assert CompareLtELtE Num SubscriptLoad NameLoad Index Num Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num keyword NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str keyword Call AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr NameLoad decorator_list
N/A __future__ division future.builtins zip N/A numpy np N/A matplotlib.pyplot plt matplotlib.colors LinearSegmentedColormap _config config N/A __all__ N/A color_mapper colors_from_cmap cycle_cmap LinearColormap LinearColormap N/A LinearSegmentedColormap N/A N/A Create Matplotlib colormap with color values specified at key points.

    This class simplifies the call signature of LinearSegmentedColormap. By
    default, colors specified by `color_data` are equally spaced along the
    colormap.

    Parameters
    ----------
    name : str
        Name of colormap.
    color_data : list or dict
        Colors at each index value. Two input types are supported:

            List of RGB or RGBA tuples. For example, red and blue::

                color_data = [(1, 0, 0), (0, 0, 1)]

            Dict of 'red', 'green', 'blue', and (optionally) 'alpha' values.
            For example, the following would give a red-to-blue gradient::

                color_data = {'red': [1, 0], 'green': [0, 0], 'blue': [0, 1]}

    index : list of floats (0, 1)
        Note that these indices must match the length of `color_data`.
        If None, colors in `color_data` are equally spaced in colormap.

    Examples
    --------
    Linear colormap going from white to red

    >>> white_red = LinearColormap('white_red', [(1, 1, 1), (0.8, 0, 0)])

    Colormap going from blue to white to red

    >>> bwr = LinearColormap('blue_white_red', [(0.0, 0.2, 0.4),    # blue
    ...                                         (1.0, 1.0, 1.0),    # white
    ...                                         (0.4, 0.0, 0.1)])   # red

    You can use a repeated index to get a segmented color.
    - Blue below midpoint of colormap, red above mid point.
    - Alpha maximum at the edges, minimum in the middle.

    >>> bcr_rgba = [(0.02, 0.2, 0.4, 1),    # grayish blue, opaque
    ...             (0.02, 0.2, 0.4, 0.3),  # grayish blue, transparent
    ...             (0.4,  0.0, 0.1, 0.3),  # dark red, transparent
    ...             (0.4,  0.0, 0.1, 1)]    # dark red, opaque
    >>> blue_clear_red = color.LinearColormap('blue_clear_red', bcr_rgba,
    ...                                       index=[0, 0.5, 0.5, 1])

     __init__ N/A N/A self name color_data index N/A None kwargs N/A N/A N/A N/A hasattr color_data keys N/A N/A color_data N/A rgb_list_to_colordict color_data N/A N/A index None N/A N/A index N/A N/A np linspace 0 1 N/A len N/A color_data N/A red N/A color_data N/A dict N/A N/A key N/A N/A x y y N/A N/A x y N/A zip index value N/A N/A key value N/A N/A color_data items N/A N/A N/A LinearSegmentedColormap __init__ self name color_data kwargs N/A N/A rgb_list_to_colordict N/A N/A rgb_list N/A N/A N/A colors_by_channel N/A list N/A zip rgb_list N/A channels N/A red green blue alpha N/A N/A dict N/A N/A color value N/A N/A color value N/A zip channels colors_by_channel N/A N/A CMAP_RANGE N/A N/A config N/A color N/A cmap_range color_mapper N/A N/A parameter_range cmap start stop N/A None None None N/A N/A Return color mapper, which returns color based on parameter value.

    Parameters
    ----------
    parameter_range : tuple of floats
        Minimum and maximum value of parameter.

    cmap : str or colormap
        A matplotlib colormap (see matplotlib.pyplot.cm) or the name of one.

    start, stop: 0 <= float <= 1
        Limit colormap to this range (start < stop 1). You should limit the
        range of colormaps with light values (assuming a white background).

    Returns
    -------
    map_color : function
        Function that returns an RGBA color from a parameter value.

     N/A N/A cmap None N/A N/A cmap N/A N/A config N/A color N/A cmap N/A N/A isinstance cmap str N/A N/A cmap N/A getattr N/A plt cm cmap N/A crange N/A list N/A N/A CMAP_RANGE get N/A cmap name N/A 0 1 N/A N/A start None N/A N/A start N/A crange N/A 0 N/A N/A stop None N/A N/A stop N/A crange N/A 1 N/A N/A 0 start 1 N/A N/A 0 stop 1 N/A N/A pmin pmax parameter_range map_color N/A N/A val N/A N/A N/A Return color based on parameter value `val`. N/A N/A pmin val pmax N/A val_norm N/A N/A N/A val pmin N/A float N/A stop start N/A pmax pmin N/A idx N/A val_norm start N/A N/A cmap idx N/A N/A map_color N/A colors_from_cmap N/A N/A length cmap start stop N/A 50 None None None N/A N/A Return color cycle from a given colormap.

    Parameters
    ----------
    length : int
        The number of colors in the cycle. When `length` is large (> ~10), it
        is difficult to distinguish between successive lines because successive
        colors are very similar.

    cmap : str
        Name of a matplotlib colormap (see matplotlib.pyplot.cm).

    start, stop: 0 <= float <= 1
        Limit colormap to this range (start < stop 1). You should limit the
        range of colormaps with light values (assuming a white background).
        Some colors have default start/stop values (see `CMAP_RANGE`).

    Returns
    -------
    colors : list
        List of RGBA colors.

    See Also
    --------
    cycle_cmap

     N/A N/A cmap None N/A N/A cmap N/A N/A config N/A color N/A cmap N/A N/A isinstance cmap str N/A N/A cmap N/A getattr N/A plt cm cmap N/A crange N/A list N/A N/A CMAP_RANGE get N/A cmap name N/A 0 1 N/A N/A start None N/A N/A N/A crange N/A 0 start N/A N/A stop None N/A N/A N/A crange N/A 1 stop N/A N/A 0 N/A crange N/A 0 1 N/A N/A 0 N/A crange N/A 1 1 N/A idx N/A N/A np linspace N/A crange N/A 0 N/A crange N/A 1 num length N/A N/A cmap idx N/A cycle_cmap N/A N/A length cmap start stop ax N/A 50 None None None None N/A N/A Set default color cycle of matplotlib based on colormap.

    Note that the default color cycle is **not changed** if `ax` parameter
    is set; only the axes's color cycle will be changed.

    Parameters
    ----------
    length : int
        The number of colors in the cycle. When `length` is large (> ~10), it
        is difficult to distinguish between successive lines because successive
        colors are very similar.

    cmap : str
        Name of a matplotlib colormap (see matplotlib.pyplot.cm).

    start, stop: 0 <= float <= 1
        Limit colormap to this range (start < stop 1). You should limit the
        range of colormaps with light values (assuming a white background).
        Some colors have default start/stop values (see `CMAP_RANGE`).

    ax : matplotlib axes
        If ax is not None, then change the axes's color cycle instead of the
        default color cycle.

    See Also
    --------
    colors_from_cmap, color_mapper

     N/A color_cycle N/A colors_from_cmap length cmap start stop N/A N/A ax None N/A N/A N/A N/A plt rc axes color_cycle N/A N/A color_cycle tolist N/A N/A N/A N/A ax set_color_cycle color_cycle N/A