# 2021 Nathan Nguyen
# Source: Patrick Loeber - https://github.com/python-engineer/snake-ai-pytorch
#
# Plots scores for each game played in training and the mean score.

import matplotlib.pyplot as plt
from IPython import display

plt.ion()

def plot(scores, mean_scores):
  display.clear_output(wait=True)
  display.display(plt.gcf())
  plt.clf()
  plt.title("BombsQQ Training...")
  plt.xlabel("Number of Games")
  plt.ylabel("Score")
  plt.plot(scores)
  plt.plot(mean_scores)
  plt.ylim(ymin=0)
  plt.text(len(scores) - 1, scores[-1], str(scores[-1]))
  plt.text(len(mean_scores) - 1, mean_scores[-1], str(mean_scores))