frites.plot.plot_conn_circle#

frites.plot.plot_conn_circle(conn, signed=False, directed=False, edges_cmap='hot_r', edges_vmin=None, edges_vmax=None, edges_lw=3.0, edges_alpha=1.0, nodes_data='degree', nodes_cmap='hot_r', nodes_size=None, nodes_size_min=1.0, nodes_size_max=50.0, nodes_bad=None, nodes_label_fz=8, nodes_label_color=None, nodes_label_shift=0.0, categories=None, categories_sep=3, cbar=True, cbar_title=None, cbar_kw={}, cbar_size=0.8, cbar_pos=(0.8, 0.4), prop=None, angle_start=90, angle_span=360, padding=0.0, ax=None)[source]#

Plot the connectivity matrix in a circle.

Note

Note: This code is based on the circle graph example by Nicolas P. Rougier http://www.labri.fr/perso/nrougier/coding/ and has then be modified within MNE-Python (v0.14)

Parameters
connxarray.DataArray | pandas.DataFrame | numpy.ndarray

Either a 2D xarray.DataArray or a pandas DataFrame or a 2D NumPy array

signedbool | python:False

Specifiy whether the connectivity metric is signed (e.g. pearson or spearman correlation) or unsigned (e.g. mutual information, distance)

directedbool | python:False

Specify whether it is directed connectivity (True) or undirected connectivity (False, default)

edges_cmappython:str | ‘hot_r’

Colormap to use for coloring the connections.

edges_vminpython:float | python:None

Minimum value for colormap of edges. If None, the minimum among finite values will be used instead.

edges_vmaxpython:float | python:None

Maximum value for colormap of edges. If None, the maximum among finite values will be used instead.

edges_lwpython:float | 3.

Line width of the strongest edges.

edges_alphapython:float | 1.

Minimum transparency level for plotting edges. If 1 (default), all of the edges are going to be opaque while if 0 weakest edges are going to be transparent

nodes_datanumpy:array_like, srt | python:None

Data to use for coloring the boxes of each node. Use either :

  • A array like of length (n_nodes,)

  • ‘degree’ for the degree (i.e. the number of connections) of each node

  • ‘mean’ for the mean connectivity of this node

  • ‘diagonal’ use the values on the diagonal of the connectivity matrix

  • ‘number’ for coloring according to the node number

nodes_sizenumpy:array_like, python:str | python:None

Data to use for controlling the size of the nodes. This parameter is similar to the nodes_data above as array can be provided or string values like ‘degree’, ‘mean’, ‘diagonal’ etc.

nodes_size_min, nodes_size_maxpython:float | 1., 50.

Minimum and maximum sizes of the nodes

nodes_cmappython:str | ‘hot_r’

Colormap to use for coloring the nodes.

nodes_badpython:str | python:None

Color to use for bad nodes (i.e. nodes with non finite values in nodes_data). By default, those nodes are transparent.

nodes_label_fzpython:float | 8

Font size of nodes’ labels.

nodes_label_shiftpython:float | 0.

Shift to apply to the labels (i.e. the nodes names)

nodes_label_colornumpy:array_like | python:list | python:None

Color to apply to each node label

categoriesnumpy:array_like | python:None

Category associated to each region name. Can be hemisphere name, lobe name or indices describing group of regions. By default, a space is introduced between categories (see categories_sep below for controlling the amount of space to use)

categories_seppython:float | 3

Space size between categories.

cbarbool | python:True

Add the colorbar

cbar_titlepython:str | python:None

Colorbar title

cbar_kwpython:dict | {}

Additional arguments for controlling the colorbar title (e.g. cbar_kw={‘fontweight’: ‘bold’, ‘fontsize’: 20})

cbar_sizepython:float | .8

Size of the colorbar

cbar_pospython:tuple | (.8, .4)

(x, y) position of the colorbar.

proppython:float | python:None

Proportion of edges to keep. For example, prop=5 means that 95th percentile will be used for thresholding the connections.

angle_startpython:float | 90

Angle at which to start the first node (in degree)

angle_spanpython:float | 360

Angle spanning (in degree). By default, a full circle is used (360°). For half a circle, use 180°.

paddingpython:float | 0.

Add some space arround plot.

axmatplotlib Axes | python:None

Matplotlib axis (to add to a subplot for example). The axis must have a polar projection (e.g. fig.add_subplot(1, 2, 2, polar=True))

Returns
axmatplotlib Axes

Axes object with the circular plot