egttools.plotting.plot_gradients

plot_gradients(gradients, fig_title=None, xlabel='frequency of strategy 0', ylabel='gradient of selection (G)', figsize=(7, 5), color='b', linelabel=None, linewidth_gradient=3, marker=None, marker_plot_freq=1, marker_linewidth=3, marker_size=20, marker_facecolor='b', marker_edgecolor='b', roots=None, stability=None, linewidth_edges=3, edgecolors='black', nodesize=100, nodeborder_width=3, arrowstyle='-|>', nb_minor_ticks=2, major_ticks_length=7, minor_ticks_length=4, ticks_width=2, ticks_labels_size=15, ticks_direction='in', ticks_labels_pad=10, ticks_labels_fontweight='bold', axis_labels_fontweight='bold', axis_labels_fontsize=15, ticks_left=True, ticks_right=True, ticks_top=True, ticks_bottom=True, spine_left_linewidth=2, spine_right_linewidth=2, spine_top_linewidth=2, spine_bottom_linewidth=2, ax=None)[source]

This function plots the gradient of selection for 1-simplexes (only two strategies).

There is the possibility of plotting the stationary points (roots) of the system and their stability, but it is recommended that you only do this when analysing the replicator equation.

Parameters
  • gradients (a numpy array with the gradients to plot.) –

  • fig_title (a title for the figure.) –

  • xlabel (the label of the x axis.) –

  • ylabel (the label of the y axis.) –

  • figsize (the dimensions of the figure.) –

  • color (the color to use to plot the line.) –

  • linelabel (label assigned to the plotted line.) –

  • linewidth_gradient (width of the gradient curve.) –

  • marker (use a marker to plot the points (by default no marker is shown).) –

  • marker_plot_freq (how often to plot a marker (so that there aren't many overlapping).) –

  • marker_linewidth (linewidth of the edge of the marker.) –

  • marker_size (size of the marker.) –

  • marker_facecolor (marker fill color.) –

  • marker_edgecolor (marker edge color.) –

  • roots (a list of numpy arrays containing the coordinates of the stationary points of the dynamical system.) –

  • stability (a list of integers indicating the stability of the roots (-1 - unstable, 0 - saddle, 1 - stable).) –

  • linewidth_edges (width of the arrows indicating the direction of the gradients.) –

  • edgecolors (color of the arrows indicating the direction of selection.) –

  • nodesize (size of the circles representing the roots.) –

  • nodeborder_width (width of the border of the circles.) –

  • arrowstyle (style of the arrows that represent the direction of selection.) –

  • nb_minor_ticks (number of minor ticks to display.) –

  • major_ticks_length (length of major ticks.) –

  • minor_ticks_length (length of minor ticks.) –

  • ticks_width (width of the ticks.) –

  • ticks_labels_size (size of the tick labels.) –

  • ticks_direction (direction of the ticks ("in" or "out").) –

  • ticks_labels_pad (pad for the labels of the ticks.) –

  • ticks_labels_fontweight (font weight of the tick labels (e.g., "bold').) –

  • axis_labels_fontweight (font weight of the axis labels (e.g., "bold').) –

  • axis_labels_fontsize (font size of the axis labels.) –

  • ticks_left (indicates whether to display ticks on the left spine.) –

  • ticks_right (indicates whether to display ticks on the right spine.) –

  • ticks_top (indicates whether to display ticks on the top spine.) –

  • ticks_bottom (indicates whether to display ticks on the bottom spine.) –

  • spine_left_linewidth (line width of the left spine.) –

  • spine_right_linewidth (line width of the right spine.) –

  • spine_top_linewidth (line width of the top spine.) –

  • spine_bottom_linewidth (line width of the bottom spine.) –

  • ax (a matplotlib.pyplot axis object in which this figure will be plot. If None, then a new axis and figure will) – be created.

Return type

axis

Returns

  • matplotlib.pyplot.axis

  • The axis in which the figure has been plot.