egttools.plotting.network_plots.plot_strategy_by_degree¶
- plot_strategy_by_degree(degrees, population, nb_strategies, strategy_names=None, strategy_colors=None, ax=None, bins='auto', xlabel='Node degree', ylabel='Strategy frequency', title='Strategy distribution by degree')[source]¶
Plot the frequency of each strategy stratified by node degree.
Useful for heterogeneous networks (e.g. Barabási–Albert scale-free graphs) to reveal whether hub nodes and peripheral nodes adopt different strategies.
- Parameters:
degrees (sequence of int) – Degree of each node (length N).
population (sequence of int) – Current strategy of each node (length N).
nb_strategies (int)
strategy_names (sequence of str, optional)
strategy_colors (sequence, optional)
ax (matplotlib.axes.Axes, optional)
bins (int or str) – Number of degree bins, or
'auto'to use unique degree values.xlabel (str)
ylabel (str)
title (str)
- Return type:
matplotlib.axes.Axes