I'm trying to create the average heatmap from multiple heatmaps.
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from scipy import misc
f1 = misc.imread('heatmap1.png')
f2 = misc.imread('heatmap2.png')
f3 = misc.imread('heatmap3.png')
You should use
plt.imshow(f_avg.astype(np.uint8)) so that
imshow can detect that this is an image and not arbitrary floating-point data. I don't have access to all three of your images, but if I test using
f1 three times, or with random noise images, this change makes the code behave as I would expect (where it doesn't without the change).
Also beware that these image arrays have RGB values and an alpha value that are all getting averaged - the average of these three images won't necessarily be the same as the heatmap you'd get with all of the data included (but it's a good rough estimate, if that's all you have access to).