egttools.plotting.network_plots.plot_network_state¶
- plot_network_state(G, population, strategy_names=None, strategy_colors=None, ax=None, layout=None, node_size=80, edge_color='#aaaaaa', edge_alpha=0.5, legend=True)[source]¶
Draw a network snapshot with nodes coloured by their current strategy.
- Parameters:
G (networkx.Graph (or any object with an
.adjacency()method)) – The network topology.population (
Sequence[int]) – Strategy index of each node (same order aslist(G.nodes())).strategy_names (
Optional[Sequence[str]]) – Labels for each strategy. Defaults to["Strategy 0", ...].strategy_colors (
Optional[Sequence]) – Colours for each strategy.ax (
Optional[Axes]) – Existing axes to draw on.layout (
Optional[Dict[int,Tuple[float,float]]]) –{node: (x, y)}positions. Computed via NetworkX spring layout if omitted.node_size (
int)edge_color (
str)edge_alpha (
float)legend (
bool) – Whether to draw a strategy legend.
- Return type:
Axes