pyamr.utils.plot

Functions

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

Examples using pyamr.utils.plot.hlinebgplot

Table Boxplot

Table Boxplot
pyamr.utils.plot.plot_sns_clustermap()[source]
pyamr.utils.plot.plot_sns_heatmap()[source]
pyamr.utils.plot.plot_sns_relmap()[source]
pyamr.utils.plot.plot_spectrum()[source]
pyamr.utils.plot.plot_timeseries()[source]
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

Examples using pyamr.utils.plot.scalar_colormap

Step 01 - Compute AMR metrics

Step 01 - Compute AMR metrics

Spectrum of Activity (ASAI)

Spectrum of Activity (``ASAI``)

Table Boxplot

Table Boxplot
pyamr.utils.plot.vlinebgplot(ax, top, xv, bg=None)[source]

This function adds a vertical line and background

Parameters:
  • ax (matplotlib axes)

  • top (float) – The max y value

  • xv (float) – The x value

  • bg (boolean) – Whether to include a background

Examples using pyamr.utils.plot.vlinebgplot

Table Scatterplot

Table Scatterplot

Classes

class pyamr.utils.plot.MidpointNormalize(vmin=None, vmax=None, midpoint=None, clip=False)[source]

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)

Examples using pyamr.utils.plot.MidpointNormalize

Plot function

Plot function