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:
- conn
xarray.DataArray|pandas.DataFrame|numpy.ndarray Either a 2D xarray.DataArray or a pandas DataFrame or a 2D NumPy array
- signedbool |
False Specifiy whether the connectivity metric is signed (e.g. pearson or spearman correlation) or unsigned (e.g. mutual information, distance)
- directedbool |
False Specify whether it is directed connectivity (True) or undirected connectivity (False, default)
- edges_cmap
str| ‘hot_r’ Colormap to use for coloring the connections.
- edges_vmin
float|None Minimum value for colormap of edges. If None, the minimum among finite values will be used instead.
- edges_vmax
float|None Maximum value for colormap of edges. If None, the maximum among finite values will be used instead.
- edges_lw
float| 3. Line width of the strongest edges.
- edges_alpha
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|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,
str|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_max
float| 1., 50. Minimum and maximum sizes of the nodes
- nodes_cmap
str| ‘hot_r’ Colormap to use for coloring the nodes.
- nodes_bad
str|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_fz
float| 8 Font size of nodes’ labels.
- nodes_label_shift
float| 0. Shift to apply to the labels (i.e. the nodes names)
- nodes_label_colornumpy:array_like |
list|None Color to apply to each node label
- categoriesnumpy:array_like |
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_sep
float| 3 Space size between categories.
- cbarbool |
True Add the colorbar
- cbar_title
str|None Colorbar title
- cbar_kw
dict| {} Additional arguments for controlling the colorbar title (e.g. cbar_kw={‘fontweight’: ‘bold’, ‘fontsize’: 20})
- cbar_size
float| .8 Size of the colorbar
- cbar_pos
tuple| (.8, .4) (x, y) position of the colorbar.
- prop
float|None Proportion of edges to keep. For example, prop=5 means that 95th percentile will be used for thresholding the connections.
- angle_start
float| 90 Angle at which to start the first node (in degree)
- angle_span
float| 360 Angle spanning (in degree). By default, a full circle is used (360°). For half a circle, use 180°.
- padding
float| 0. Add some space arround plot.
- ax
matplotlibAxes|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))
- conn
- Returns:
- ax
matplotlibAxes Axes object with the circular plot
- ax