0

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.

2
  • So how does the not-working code look like? Commented Oct 14, 2014 at 9:42
  • 1
    Ok, and how is the structure of your data file? If it is a matrix, you must use plot 'file' matrix with image. Commented Oct 14, 2014 at 10:06

1 Answer 1

2

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.