pyamr.utils package
Subpackages
Submodules
pyamr.utils.plot module
Classes:
|
Normalise the colorbar so that diverging bars work their way either side from a prescribed midpoint value) |
Functions:
|
This method constructs a mapper |
|
Creates the colors for the different elements in a given categorical feature vector. |
|
This function adds a vertical line and background |
|
This method creates a colormap based on values. |
|
This function adds a vertical line and background |
- class pyamr.utils.plot.MidpointNormalize(vmin=None, vmax=None, midpoint=None, clip=False)[source]
Bases:
Normalize
Normalise the colorbar so that diverging bars work their way either side from a prescribed midpoint value)
Example
> MidpointNormalize(midpoint=0., vmin=-100, vmax=100)
- pyamr.utils.plot.create_mapper(dataframe, column_key, column_value)[source]
This method constructs a mapper
- Parameters:
dataframe (dataframe-like) – The dataframe from which the columns are extracted
column_key (string-like) – The name of the column with the values for the keys of the mapper
column_value (string-like) – The name of the column with the values for the values of the mapper
- Return type:
dictionary
- pyamr.utils.plot.get_category_colors(index, category, cmap='hls')[source]
Creates the colors for the different elements in a given categorical feature vector.
- Parameters:
values (array-like) – The vector with the categorical values
cmap (string-like) – The colormap to use
default (string-like) – The color to be used for the first value. Note that this value needs to appear first on the the sorted list, as such it is recommended to set is as _default.
- Returns:
List of colors.
- Return type:
pd.Series
- pyamr.utils.plot.hlinebgplot(ax, right, yv, bg=None)[source]
This function adds a vertical line and background
- pyamr.utils.plot.scalar_colormap(values, cmap, vmin, vmax)[source]
This method creates a colormap based on values.
- Parameters:
values (array-like)
The values to create the corresponding colors
cmap (str)
The colormap
vmin, vmax (float)
The minimum and maximum possible values
- Return type:
scalar colormap