draw_stacked_circles#

SplitGraph.draw_stacked_circles(ax=None, inner_node_color_neg='k', boundary_node_color_neg='r', inner_node_color_pos='k', boundary_node_color_pos='r', edge_color=(0, 0, 0, 0.05), node_size=10, marked_nodes_indicator=None, marked_node_sizes=None, marked_nodes_colors=None, horizontal=False, flip_pos_side=False, center_boundary_parts=True, fixed_stack_distance=None, prev_pos=None, update=0.5)#

Visualise a bipartition by plotting the nodes arranged in circles.

Like in draw_ellipses() we have four parts:

  • the first contains the nodes of the negative side of sep that don’t have a connection to the positive side;

  • the second contains the nodes of the negative side of sep that have a connection to the positive side;

  • the third contains the nodes of the positive side of sep that have a connection to the negative side;

  • the fourth contains the nodes of the positive side of sep that don’t have a connection to the negative side.

Additionally the parts are split into connected components. Every one of these connected components is drawn as circle with a diameter proportional to the size, the connected components of a part are stacked horizontally.

Parameters#

ax

A matplotlib axes object.

inner_node_color, boundary_node_color

Colors for the different types of nodes.

edge_color

Color for the edges.

node_size

Size of the nodes (in ‘NetworkX units’).

marked_nodes_indicator

A vector containing non-negative integers, nodes at indices with a non-zero entry are ‘marked’ and drawn in a different color.

marked_node_sizes

A list of sizes, the size of node at index i is marked_nodes_sizes[marked_nodes_indicator[i] - 1] if i>0, else the normal size is used.

marked_nodes_colors

A list of colors, the color of node at index i is marked_nodes_colors[marked_nodes_indicator[i] - 1] if i>0, else the normal color is used.

horizontal

Whether the four stacks are drawn horizontal.

flip_pos_side

Whether the stack of the positive side is drawn in reversed order.

center_boundary_parts

Whether to force the mid between the boundary stacks to be at coordinate zero.

fixed_stack_distance

Whether to keep the distance between stacks fixed.

prev_pos

Previous node positions.

update

Update factor to interpolate between positions:

drawn_pos = (1-update) * prev_pos + update*pos.

Returns#

np.ndarray

The new positions (used mainly for the movie).