when plot
set terminal png
set output 'plot.png'
plot 'matrix.txt' matrix with image
9 3 3 4
3 1 1 7
8 9 1 8
7 3 9 5
I get
Do you see, its rotated / flipped. How align it with data?
I found Rotating a plot in gnuplot but solution does not apply here.
Are you asking how to invert the direction of the y axis?
set yrange [*:*] reverse
plot 'matrix.txt' matrix with image
Or if you want to invert the y coordinates of the matrix but leave the orientation of other plot elements unchanged
plot 'matrix.txt' using ($1):(-$2):($3) matrix with image