Visualize distributions of network properties
- braindynamics_starprotocol.network.plot.plot_Cliffs_delta(deltas: ndarray, sorting: ndarray = None, fig: Figure = None, axes: list[Axes] = None, clabel: str = '', show_cbar: bool = False, titles: list[str] = None) None[source]
Plot Cliff’s delta statistic resulting from the comparison of two 2D distributions. Two separate axes are plotted, one with the delta values and the other showing the absolute thresholds representing significance based on Vargha et al. 2000
- Parameters:
deltas (np.ndarray) – Array of Cliff deltas
sorting (np.ndarray, optional) – Sorting indices of the first dimension (e.g. nodes). Defaults to None.
fig (matplotlib.figure.Figure, optional) – Plot on given matplotlib figure if given. Defaults to None.
ax (matplotlib.axes._axes.Axes, optional) – Plot on given matplotlib axis if given. Defaults to None.
clabel (str, optional) – Label of the colorbar if given. Defaults to “”.
show_cbar (bool, optional) – Show colorbar or not. Defaults to False.
titles (list[str], optional) – Title of the plots if given. Defaults to None.
- Raises:
ValueError – The number of provided axes is not two (one for deltas, another one for the thresholded values)
- braindynamics_starprotocol.network.plot.plot_distribution(data: ~numpy.ndarray, sorting: ~numpy.ndarray = None, fig: ~matplotlib.figure.Figure = None, ax: ~matplotlib.axes._axes.Axes = None, cmap: ~matplotlib.colors.LinearSegmentedColormap = <matplotlib.colors.LinearSegmentedColormap object>, cmin: float = None, cmax: float = None, clabel: str = '', show_cbar: bool = False, xlabel: str = None, ylabel: str = None, title: str = None, vmin: float = None, vmax: float = None, yticks: ~numpy.ndarray = None, mirror_yticks: bool = False) None[source]
Function that plots a heatmap based on a 2D array. It can be used to visualize distributions (EWD, NDD, N-EWD) or to plot the results of their comparison (Cliff’s delta values).
- Parameters:
data (np.ndarray) – Array of 2D.
sorting (np.ndarray, optional) – Sorting indices of the first dimension (e.g. nodes). Defaults to None.
fig (matplotlib.figure.Figure, optional) – Plot on given matplotlib figure if given. Defaults to None.
ax (matplotlib.axes._axes.Axes, optional) – Plot on given matplotlib axis if given. Defaults to None.
cmap (matplotlib.colors.LinearSegmentedColormap, optional) – Colormap of the heatmap. Defaults to cm.coolwarm.
cmin (float, optional) – Minimum value of the colorbar if given. Defaults to None.
cmax (float, optional) – Maximum value of the colorbar if given. Defaults to None.
clabel (str, optional) – Label of the colorbar if given. Defaults to “”.
show_cbar (bool, optional) – Show colorbar or not. Defaults to False.
xlabel (str, optional) – Label of the x axis of the heatmap if given. Defaults to None.
ylabel (str, optional) – Label of the y axis of the heatmap if given. Defaults to None.
title (str, optional) – Title of the plot if given. Defaults to None.
vmin (float, optional) – First tick label of the x axis if given. Defaults to None.
vmax (float, optional) – Last tick label of the x axis if given. Defaults to None.
yticks (np.ndarray, optional) – Array of tick labels of the y axis of the heatmap (e.g. node names). Defaults to None.
mirror_yticks (bool, optional) – Mirror tick labels of the y axis or not (useful for readability, labels with odd indices appear on the left, even ones on the right). Defaults to False.