finesse.plotting.graph.plot_nx_graph

finesse.plotting.graph.plot_nx_graph(network, layout, node_labels=True, node_attrs=False, edge_attrs=False, node_color_key=None, label_font_size=12, attr_font_size=6, edge_font_size=6, **kwargs)[source]

Plot graph with NetworkX.

Parameters

network : networkx.Graph

The network to plot.

layout : str

The layout type to use. Any layout algorithm provided by networkx.drawing.layout is supported.

node_labels : bool, optional

Show node names; defaults to True.

node_attrs : bool or list, optional

Show node data. This can be True, in which case all node data is shown, or a list, in which case only the specified keys are shown. Defaults to True.

edge_attrs : bool or list, optional

Show edge data. This can be True, in which case all edge data is shown, or a list, in which case only the specified keys are shown. Defaults to True.

node_color_key : callable, optional

Key function accepting a node and a node attribute dict and returning a group. Each group is assigned a unique color. If not specified, nodes are not colored.

label_font_size, attr_font_size, edge_font_size : int, optional

Font size for node labels, attributes and edges. Defaults to 12, 6 and 6, respectively.

Other Parameters

kwargs

Anything else supported by networkx.drawing.nx_pylab.draw().

Raises

ValueError

If the specified layout is not supported.

Exception

If the graph cannot be represented with the specified layout.