code: def write_messages(ax, messages):
      
      tc = "gray"
      axt = ax.transAxes
      yy = .95
      for msg in messages:
          ax.text(.95, yy, msg, color=tc, transform=axt, ha="right")
          yy -= .05
docs: Write text on canvas, usually on the top right corner.