if you don't supply the axes handle to plot on, it will use gca axes to plot on. If there are no axes to plot on, gca will create new one.
ax(1) = axes(figure(1))
ax(2) = axes(figure(2))
Replace your imagesc line with this one
However, having 5 figures open is not the tidiest way to do it, consider using subplots.