pycolorbar.norm package#

Submodules#

pycolorbar.norm.categorical module#

Define categorical norms.

class pycolorbar.norm.categorical.CategorizeNorm(boundaries, labels)[source][source]#

Bases: BoundaryNorm

Generates a colormap index based on a set of intervals into which discretize a continuous variable.

Similarly to BoundaryNorm, CategorizeNorm maps values to integers instead of to the interval 0-1.

Create a CategorizeNorm instance.

Parameters:
  • boundaries (list) – Set of intervals into which categorize the continuous variable.

  • labels (list) – Name of the discretized intervals.

Notes

Appropriate colorbar ticks and ticklabels can be retrieved from the ticks and ticklabels attributes.

class pycolorbar.norm.categorical.CategoryNorm(categories)[source][source]#

Bases: BoundaryNorm

Generate a colormap index based on a category dictionary.

Similarly to BoundaryNorm, CategoryNorm maps values to integers instead of to the interval 0-1.

Create a CategoryNorm instance.

Parameters:

categories (dict) – Dictionary specifying categories id (keys) and class labels (values). The keys must be integers.

Notes

Appropriate colorbar ticks and ticklabels can be retrieved from the ticks and ticklabels attributes.

pycolorbar.norm.categorical.check_boundaries(boundaries, arg_name='boundaries')[source][source]#

Check boundaries/levels validity.

pycolorbar.norm.categorical.check_categories(categories)[source][source]#

Check categories dictionary validity.

pycolorbar.norm.categorical.is_categorical_norm(norm)[source][source]#

Check if a norm is categorical.

pycolorbar.norm.categorical.is_monotonically_increasing(x)[source][source]#

Check if a list of values is monotonically increasing.

Module contents#

Initialize norm module.

class pycolorbar.norm.CategorizeNorm(boundaries, labels)[source][source]#

Bases: BoundaryNorm

Generates a colormap index based on a set of intervals into which discretize a continuous variable.

Similarly to BoundaryNorm, CategorizeNorm maps values to integers instead of to the interval 0-1.

Create a CategorizeNorm instance.

Parameters:
  • boundaries (list) – Set of intervals into which categorize the continuous variable.

  • labels (list) – Name of the discretized intervals.

Notes

Appropriate colorbar ticks and ticklabels can be retrieved from the ticks and ticklabels attributes.

class pycolorbar.norm.CategoryNorm(categories)[source][source]#

Bases: BoundaryNorm

Generate a colormap index based on a category dictionary.

Similarly to BoundaryNorm, CategoryNorm maps values to integers instead of to the interval 0-1.

Create a CategoryNorm instance.

Parameters:

categories (dict) – Dictionary specifying categories id (keys) and class labels (values). The keys must be integers.

Notes

Appropriate colorbar ticks and ticklabels can be retrieved from the ticks and ticklabels attributes.

pycolorbar.norm.check_boundaries(boundaries, arg_name='boundaries')[source][source]#

Check boundaries/levels validity.

pycolorbar.norm.check_categories(categories)[source][source]#

Check categories dictionary validity.

pycolorbar.norm.is_categorical_norm(norm)[source][source]#

Check if a norm is categorical.