visbrain.utils.array2colormap

visbrain.utils.array2colormap(x, cmap='inferno', clim=None, alpha=1.0, vmin=None, vmax=None, under='dimgray', over='darkred', translucent=None, faces_render=False)[source][source]

Transform an array of data into colormap (array of RGBA).

Parameters:
x: array

Array of data

cmap : string | inferno

Matplotlib colormap

clim : tuple/list | None

Limit of the colormap. The clim parameter must be a tuple / list of two float number each one describing respectively the (min, max) of the colormap. Every values under clim[0] or over clim[1] will peaked.

alpha : float | 1.0

The opacity to use. The alpha parameter must be between 0 and 1.

vmin : float | None

Threshold from which every color will have the color defined using the under parameter bellow.

under : tuple/string | ‘dimgray’

Matplotlib color for values under vmin.

vmax : float | None

Threshold from which every color will have the color defined using the over parameter bellow.

over : tuple/string | ‘darkred’

Matplotlib color for values over vmax.

translucent : tuple | None

Set a specific range translucent. With f_1 and f_2 two floats, if translucent is :

  • (f_1, f_2) : values between f_1 and f_2 are set to translucent
  • (None, f_2) x <= f_2 are set to translucent
  • (f_1, None) f_1 <= x are set to translucent
faces_render : boll | False

Precise if the render should be applied to faces

Returns:
color : array_like

Array of RGBA colors