gnuplot matrix heat map plot flipped

1k Views Asked by At

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

enter image description here

Do you see, its rotated / flipped. How align it with data?

I found Rotating a plot in gnuplot but solution does not apply here.

1

There are 1 best solutions below

0
On BEST ANSWER

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