eelbrain.plot.soft_threshold_colormap

eelbrain.plot.soft_threshold_colormap(cmap, threshold, vmax, subthreshold=None, symmetric=None, alpha=1)

Soft-threshold a colormap to make small values transparent

Parameters
  • cmap (str) – Base colormap.

  • threshold (float) – Value at which to threshold the colormap (i.e., the value at which to start the colormap).

  • vmax (float) – Intended largest value of the colormap (used to infer the location of the threshold).

  • subthreshold (matplotlib color) – Color of sub-threshold values (the default is the end or middle of the colormap, depending on whether it is symmetric).

  • symmetric (Optional[bool]) – Whether the cmap is symmetric (ranging from -vmax to vmax) or not (ranging from 0 to vmax). The default is True for known symmetric colormaps and False otherwise.

  • alpha (float) – Control the global alpha level (opacity) of the colormap (original colormap alpha is multiplied by alpha).

Returns

Soft-thresholded colormap.

Return type

thresholded_cmap