The code below plots a figure in evey loop and I want the average of each matrix printed as a x label. For example: ave is 40. I am not sure how to add ave of each image to xlabel.
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
a= np.random.randint(0, 100, size=(4, 600, 600))
for i in range(np.size(a,0)):
b=a[i,:,:]
ave=np.average(b)
plt.figure()
sns.heatmap(b, cmap='jet', square=True, xticklabels=False,
yticklabels=False)
plt.text(200,-20, "Relative Error", fontsize = 15, color='Black')
plt.xlabel("ave is...")
plt.show()