import matplotlib.pyplot as plt
import nashpy as nash
import numpy as np

A = np.array([[2, 1], [3, 0]])
game = nash.Game(A)
y0 = np.array([0.95, 0.05])
y0q = np.array([95, 5])

discrete_sharing_population, discrete_aggressive_population = game.discrete_replicator_dynamics(y0, steps=20).T
quantize_sharing_population, quantize_aggressive_population = game.discrete_replicator_dynamics(y0q, steps=20,quantize=True).T

fig, (ax1, ax2) = plt.subplots(1, 2)

ax1.step(np.arange(0, 21, step=1),np.append(y0[0],discrete_sharing_population),label="sharer")
ax1.step(np.arange(0, 21, step=1),np.append(y0[1],discrete_aggressive_population),label="aggressor")
ax2.step(np.arange(0, 21, step=1),np.append(y0q[0],quantize_sharing_population),label="sharer")
ax2.step(np.arange(0, 21, step=1),np.append(y0q[1],quantize_aggressive_population),label="aggressor")

ax1.set_xticks(np.arange(0, 21, step=2))
ax1.set_ylim(0, 1)
ax2.set_xticks(np.arange(0, 21, step=2))
ax2.set_ylim(0, 100)

ax1.legend()
ax2.legend()