netchos.network¶
- netchos.network(conn, nodes_data=None, nodes_name=None, nodes_x=None, nodes_y=None, nodes_z=None, nodes_color=None, nodes_size=None, nodes_size_min=1, nodes_size_max=30, nodes_cmap='plasma', edges_min=None, edges_max=None, edges_width_min=0.5, edges_width_max=8, edges_opacity_min=0.1, edges_opacity_max=1.0, edges_cmap='plasma', cbar=True, cbar_title='Edges', directed=False, fig=None, kw_trace={}, kw_cbar={})[source]¶
Network plotting, either in 2D or 3D.
- Parameters
- connarray_like or DataFrame or DataArray
2D Connectivity matrix of shape (n_rows, n_cols). If conn is a DataFrame or a DataArray, the indexes and columns are used for the conn and y tick labels
- nodes_datapd.DataFrame
DataFrame that can contains nodes informations (e.g the name of the nodes, the x, y and z coordinates, values assign to the nodes etc.)
- nodes_namelist, array_like, str | None
List of names of the nodes. Alternatively, if nodes_data is provided, a string referring to a column name can be provided instead
- nodes_x, nodes_y, nodes_zlist, array_like, str | None
The x, y and potentially z coordinates of each node. Alternatively, if nodes_data is provided, a string referring to a column name can be provided instead
- nodes_color, nodes_sizelist, array_like, str | None
List of values assign to each node in order to modulate respectively the color and the size of the nodes. If None, the degree of each node is going to be used instead. Alternatively, if nodes_data is provided, a string referring to a column name can be provided instead
- nodes_size_min, nodes_size_maxfloat | 1, 30
Respectively, the minimum and maximum size to use for the markers
- nodes_cmapstr | ‘plasma’
Colormap to use in order to infer the color of each node
- edges_min, edges_maxfloat | None
Respectively the minimum and maximum to use for clipping edges values
- edges_width_min, edges_width_maxfloat | .5, .8
Respectively the minimum and maximum width to use fot the edges
- edges_opacity_min, edges_opacity_maxfloat | 0.1, 1.
Respectively the minimum and maximum opacity for edges
- edges_cmapstr | ‘plasma’
Colormap to use to infer the color of each edge
- cbarbool | True
Add a colorbar to the plot.
- cbar_titlestr | ‘Edges
Default colorbar title
- directedbool | False
Specify if the graph is undirected (False) or directed (True)
- figgo.Figure | None
plotly.graph_objects.Figure object
- kw_tracedict | {}
Additional arguments to pass to the plotly.graph_objects.Figure.add_trace method
- Returns
- figgo.Figure | None
A plotly.graph_objects.Figure object containing either the 2D network or a 3D network if the z coordinate is provided