2

I'm trying to generate a heat map from data (https://pastebin.com/AgivvGgX). The data are not in the "matrix" form.

I tried to use pm3d map and I obtained the following plot: enter image description here

I also tried to use dgrid3d and view map:

set view map
set pal def
set dgrid3d 40,40,3
splot "plot.dat" using 1:2:3 u pm3d

And I obtained the following result: enter image description here

Both the plots are not correct. The dgird3d keyword creates artifacts where there are not data points.

I obtained a nice plot using the code:

set view map
set pal def
splot "plot.dat" using 1:2:3 with points pointtype 5 pointsize 1 palette   linewidth 8

Here the result enter image description here

I would like to obtain a map similar to the latter one, but not with discrete points or squares but as a continuous heat map and have a white background where data are not present. Is it possible?

Michael
  • 5,095
  • 2
  • 13
  • 35
Simon
  • 21
  • 2

1 Answers1

2

Since your data is irregular, you should use dgrid3d. It has various options (see help dgrid3d), here is a picture I've got while trying different kernels and options:

set view map
set palette defined (0 'white', 1 'blue', 2 'green', 3 'yellow', 4 'red')
set dgrid3d 100,100 exp kdensity 10,10
splot 'plot.dat' w pm3d palette

enter image description here

set dgrid3d 100,100 gauss kdensity 30,30
replot

enter image description here

Michael
  • 5,095
  • 2
  • 13
  • 35
  • Interesting. The original data ranges from `0 to 65` but the `cbrange` of the plots are now `0 to 120` and `<50 to 400`. How to "rescale" properly depending on the `kdensity` values? And how to distinguish between existing values `=0` and missing values? The latter now look like as they would be `0`. – theozh Jan 03 '19 at 07:48
  • Thank you. I obtained different color code between values equal to zero and missing value using the option: `set dgrid3d 100,100 hann` or `set dgrid3d 100,100 box` – Simon Jan 03 '19 at 21:30