maad.util.plot_correlation_map

maad.util.plot_correlation_map(df, R_threshold=0.75, method='spearman', **kwargs)[source]

Plot the correlation map between indices in the DataFrame obtained with maad.

Parameters:
dfPanda DataFrame

DataFrame with features (ie. indices).

R_thresholdscalar between 0 to 1, default is 0.75

Show correlations with R higher than R_threshold

methodstring in {‘spearman’, ‘pearson’}, default is ‘spearman’

Choose the correlation type

**kwargs
  • figsizetuple of integers, optional, default: (4,10)

    width, height in inches.

  • titlestring, optional, default‘Spectrogram’

    title of the figure

  • xlabelstring, optional, default‘Time [s]’

    label of the horizontal axis

  • ylabelstring, optional, default‘Amplitude [AU]’

    label of the vertical axis

  • xtickstuple of ndarrays, optional, defaultnone
    • ticks : array_like => A list of positions at which ticks should be placed. You can pass an empty list to disable yticks.

    • labels : array_like, optional => A list of explicit labels to place at the given locs.

  • ytickstuple of ndarrays, optional, defaultnone
    • ticks : array_like => A list of positions at which ticks should be placed. You can pass an empty list to disable yticks.

    • labels : array_like, optional => A list of explicit labels to place at the given locs.

  • cmapstring or Colormap object, optional, default is ‘gray’

    See https://matplotlib.org/examples/color/colormaps_reference.html in order to get all the existing colormaps examples: ‘hsv’, ‘hot’, ‘bone’, ‘tab20c’, ‘jet’, ‘seismic’, ‘viridis’…

  • vmin, vmaxscalar, optional, default: None

    vmin and vmax are used in conjunction with norm to normalize luminance data. Note if you pass a norm instance, your settings for vmin and vmax will be ignored.

  • extentlist of scalars [left, right, bottom, top], optional, default: None

    The location, in data-coordinates, of the lower-left and upper-right corners. If None, the image is positioned such that the pixel centers fall on zero-based (row, column) indices.

  • nowboolean, optional, defaultTrue

    if True, display now. Cannot display multiple images. To display mutliple images, set now=False until the last call for the last image

… and more, see matplotlib

Returns:
figFigure

The Figure instance

axAxis

The Axis instance

Examples

see plot_extract_alpha_indices.py advanced example for a complete example

>>> import numpy as np
>>> import pandas as pd
>>> np.random.seed(2021)
>>> M = np.random.rand(10, 10)
>>> df = pd.DataFrame(M)
>>> indices = ['A','B','C','D','E','F','G','H','I','J']
>>> df.columns = indices
>>> maad.util.plot_correlation_map(df, R_threshold=0)