0
votes

I have a large matrix (4900 x 64), stored in a text file, that I would like to plot as a heatmap. The output image should be the dB level of each matrix element, mapped to whichever colour scale. The dB conversion is done before outputting the text file, so I only need to plot the heatmap.

I understand the very basic level of plotting 2-D data with gnuplot, I just can't seem to get the correct output when plotting the heatmap with pm3d / with image: (edit)

set terminal epscairo
set output '~/out.eps'
set palette defined (0 0 0 0.5, 1 0 0 1, 2 0 0.5 1, 3 0 1 1, 4 0.5 1 0.5, 5 1 1 0, 6 1 0.5 0, 7 1 0 0, 8 0.5 0 0) 
plot '~/Documents/MATLAB/range_doppler_out.txt' with image

Thanks in advance.

1
So how does the not-working code look like?Christoph
Ok, and how is the structure of your data file? If it is a matrix, you must use plot 'file' matrix with image.Christoph
That did it, thanks!user2742907

1 Answers

2
votes

If your data file is arranged like a matrix:

z00 z01 z02 z03 ...
z10 z11 z12 z13 ...
z20 z21 z22 z22 ...
...

then you must specify the matrix option when plotting:

plot 'file' matrix with image