plotters.cathy_plots.LogNorm

plotters.cathy_plots.LogNorm#

class plotters.cathy_plots.LogNorm(vmin=None, vmax=None, clip=False)#

Normalize a given value to the 0-1 range on a log scale.

__init__(vmin=None, vmax=None, clip=False)#
Parameters:
  • vmin (float or None) – Values within the range [vmin, vmax] from the input data will be linearly mapped to [0, 1]. If either vmin or vmax is not provided, they default to the minimum and maximum values of the input, respectively.

  • vmax (float or None) – Values within the range [vmin, vmax] from the input data will be linearly mapped to [0, 1]. If either vmin or vmax is not provided, they default to the minimum and maximum values of the input, respectively.

  • clip (bool, default: False) –

    Determines the behavior for mapping values outside the range [vmin, vmax].

    If clipping is off, values outside the range [vmin, vmax] are also transformed, resulting in values outside [0, 1]. This behavior is usually desirable, as colormaps can mark these under and over values with specific colors.

    If clipping is on, values below vmin are mapped to 0 and values above vmax are mapped to 1. Such values become indistinguishable from regular boundary values, which may cause misinterpretation of the data.

Notes

If vmin == vmax, input data will be mapped to 0.

Methods

__init__([vmin, vmax, clip])

autoscale(A)

Set vmin, vmax to min, max of A.

autoscale_None(A)

If vmin or vmax are not set, use the min/max of A to set them.

inverse(value)

Maps the normalized value (i.e., index in the colormap) back to image data value.

process_value(value)

Homogenize the input value for easy and efficient normalization.

scaled()

Return whether vmin and vmax are both set.

Attributes

clip

vmax

vmin