pycolorbar.norm package#
Submodules#
pycolorbar.norm.categorical module#
Define categorical norms.
- class pycolorbar.norm.categorical.CategorizeNorm(boundaries, labels)[source][source]#
Bases:
BoundaryNormGenerates 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:
BoundaryNormGenerate 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.
Module contents#
Initialize norm module.
- class pycolorbar.norm.CategorizeNorm(boundaries, labels)[source][source]#
Bases:
BoundaryNormGenerates 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:
BoundaryNormGenerate 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.