networkx 2.8.2 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
apply_alpha(colors, alpha, elem_list, cmap=None, vmin=None, vmax=None)

Parameters

colors : color string or array of floats (default='r')

Color of element. Can be a single color format string, or a sequence of colors with the same length as nodelist. If numeric values are specified they will be mapped to colors using the cmap and vmin,vmax parameters. See matplotlib.scatter for more details.

alpha : float or array of floats

Alpha values for elements. This can be a single alpha value, in which case it will be applied to all the elements of color. Otherwise, if it is an array, the elements of alpha will be applied to the colors in order (cycling through alpha multiple times if necessary).

elem_list : array of networkx objects

The list of elements which are being colored. These could be nodes, edges or labels.

cmap : matplotlib colormap

Color map for use if colors is a list of floats corresponding to points on a color mapping.

vmin, vmax : float

Minimum and maximum values for normalizing colors if a colormap is used

Returns

rgba_colors : numpy ndarray

Array containing RGBA format values for each of the node colours.

Apply an alpha (or list of alphas) to the colors provided.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.generators.directed.random_k_out_graph networkx.generators.directed.scale_free_graph networkx.generators.directed.random_uniform_k_out_graph

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/drawing/nx_pylab.py#1474
type: <class 'function'>
Commit: