How to control or avoid the smoothing parameters in set dgrid3d cauchy in gnuplot?

Viewed 50

I am trying to generate a heatmap(smooth) using the command "set dgrid3d NX, NY cauchy dx,dy " with my actual data points that are lying on or blending into this heatmap using Gnuplot. The data that I want to plot in a heatmap is given below:

   7.00        0.30     0.37927674E-05

   7.40        0.70     0.15792115E-04

   7.50        0.80     0.24103077E-04
 
   7.90        1.20     0.15608388E-03
   7.90        0.10     0.69352006E+01

   8.00        1.30     0.25409103E-03
   8.00        0.20     0.73455689E+01
   8.00        0.10     0.42827124E+02

   8.10        0.30     0.76748807E+01

   8.20        1.50     0.67312964E-03
   8.20        0.40     0.79137934E+01
   8.20        0.30     0.45520115E+02
 
   8.40        1.70     0.17587834E-02   
   8.40        0.50     0.46099211E+02
  
   8.50        0.60     0.45678694E+02
   8.50        0.10     0.41237359E+02

   8.60        1.90     0.44844517E-02   
   8.60        0.20     0.47934414E+02
 
   8.80        2.10     0.11075105E-01
   8.80        1.00     0.75474471E+01
   8.80        0.90     0.42642491E+02
       
   9.00        0.60     0.79618341E+02
   9.00        0.30     0.79419113E+01

   9.10        2.40     0.39978658E-01
   9.10        1.30     0.68257903E+01
   9.10        1.20     0.39538089E+02
   9.10        0.70     0.88526994E+02
   9.10        0.40     0.92384913E+01
 
   9.30        2.60     0.89027979E-01   
   9.30        1.40     0.39023052E+02  
   9.30        0.60     0.12261523E+02
 
   9.50        2.80     0.18887125E+00
   9.50        1.70     0.64384108E+01
   9.50        1.60     0.40444708E+02
   9.50        1.10     0.12644027E+03
   9.50        0.80     0.15816436E+02
   9.50        0.20     0.32175767E-02
  
   9.60        1.80     0.65175956E+01
   9.60        1.70     0.41921130E+02
   9.60        1.20     0.13614744E+03
   9.60        0.90     0.17751092E+02
   9.60        0.30     0.50078273E-02
   
   9.80        3.10     0.52966814E+00
   9.80        2.00     0.68808176E+01
   9.80        1.90     0.46203290E+02
   9.80        1.40     0.15520871E+03
   9.80        1.10     0.21777734E+02
   9.80        0.50     0.11584465E-01
   9.80        0.30     0.76065456E+00

   9.90        3.20     0.72710251E+00    
   9.90        1.20     0.23782402E+02
   9.90        0.60     0.17217548E-01
   9.90        0.40     0.84168966E+00

  10.00        3.30     0.98446456E+00
  10.00        2.20     0.74411114E+01
  10.00        2.10     0.51662822E+02
  10.00        1.60     0.17298377E+03
  10.00        1.30     0.25712114E+02
  10.00        0.70     0.25198962E-01
  10.00        0.50     0.92156261E+00
  10.00        0.10     0.11582823E+03
   
  10.20        2.30     0.57326412E+02
  10.20        1.80     0.18833726E+03
  10.20        1.50     0.29118317E+02
  10.20        0.90     0.51539998E-01
  
  10.30        3.60     0.22463999E+01
  10.30        2.50     0.83507520E+01
  10.30        2.40     0.59899307E+02
  10.30        1.90     0.19474547E+03
  10.30        1.60     0.30482513E+02
  10.30        1.00     0.72026559E-01
  10.30        0.80     0.11359693E+01
  10.30        0.40     0.14891248E+03

  10.40        3.70     0.28747059E+01
  10.40        2.60     0.85969760E+01
  10.40        2.50     0.62131472E+02
  10.40        2.00     0.20014222E+03
  10.40        1.70     0.31554021E+02
  10.40        1.10     0.99118056E-01
  10.40        0.90     0.11932870E+01
  10.40        0.50     0.15811963E+03

  10.50        3.80     0.36265029E+01
  10.50        2.70     0.87869988E+01
  10.50        2.60     0.63916599E+02
  10.50        2.10     0.20443737E+03
  10.50        1.80     0.32293887E+02
  10.50        1.20     0.13431552E+00
  10.50        1.00     0.12411641E+01
  10.50        0.60     0.16603330E+03

  10.60        3.90     0.45097533E+01
  10.60        2.80     0.89085883E+01  
  10.60        1.30     0.17923196E+00
  10.60        1.10     0.12786691E+01
  10.60        0.70     0.17250274E+03

  10.70        4.00     0.55281116E+01
  10.70        2.90     0.89534488E+01
  10.70        2.80     0.65840589E+02
  10.70        2.30     0.20955650E+03
  10.70        2.00     0.32686330E+02
  10.70        1.40     0.23551814E+00
  10.70        1.20     0.13052811E+01
  10.70        0.80     0.17744390E+03

  10.80        4.10     0.66796851E+01
  10.80        3.00     0.89175608E+01
  10.80        2.90     0.65897572E+02
  10.80        2.40     0.21040722E+03
  10.80        2.10     0.32329276E+02
  10.80        1.50     0.30476008E+00
  10.80        1.30     0.13209148E+01
  10.80        0.90     0.18084261E+03

  11.00        4.30     0.93410537E+01
  11.00        3.20     0.86086636E+01
  11.00        3.10     0.64216925E+02
  11.00        2.60     0.20907628E+03
  11.00        2.30     0.30596084E+02
  11.00        1.70     0.48733667E+00
  11.00        1.50     0.13210026E+01
  11.00        1.10     0.18328478E+03

  11.10        4.40     0.10811365E+02
  11.10        3.30     0.83476811E+01
  11.10        3.20     0.62565030E+02
  11.10        2.70     0.20714862E+03
  11.10        2.40     0.29294200E+02
  11.10        1.80     0.60226307E+00
  11.10        1.60     0.13072367E+01
  11.10        1.20     0.18260001E+03

  11.20        4.50     0.12335835E+02
  11.20        3.40     0.80286691E+01
  11.20        3.30     0.60463228E+02
  11.20        2.80     0.20457874E+03
  11.20        2.50     0.27767593E+02
  11.20        1.90     0.73300831E+00
  11.20        1.70     0.12858951E+01
  11.20        1.30     0.18088781E+03

  11.30        4.60     0.13876782E+02
  11.30        3.50     0.76638084E+01
  11.30        3.40     0.57996406E+02
  11.30        2.90     0.20151842E+03
  11.30        2.60     0.26072360E+02
  11.30        2.00     0.87864775E+00
  11.30        1.80     0.12583879E+01
  11.30        1.40     0.17835169E+03

  11.40        4.70     0.15391386E+02
  11.40        3.60     0.72660912E+01
  11.40        3.50     0.55254887E+02
  11.40        3.00     0.19810551E+03
  11.40        2.70     0.24265938E+02
  11.40        2.10     0.10373524E+01
  11.40        1.90     0.12261498E+01
  11.40        1.50     0.17519146E+03
  11.40        0.10     0.55980941E+02

  11.50        4.80     0.16833737E+02
  11.50        3.70     0.68484039E+01
  11.50        3.60     0.52328221E+02
  11.50        3.10     0.19445287E+03
  11.50        2.80     0.22403750E+02
  11.50        2.20     0.12063460E+01
  11.50        2.00     0.11905425E+01
  11.50        1.60     0.17158813E+03
  11.50        0.20     0.62066384E+02

  11.60        4.90     0.18157343E+02
  11.60        3.80     0.64227257E+01
  11.60        3.70     0.49299832E+02
  11.60        3.20     0.19064080E+03
  11.60        2.90     0.20536353E+02
  11.60        2.30     0.13819347E+01
  11.60        2.10     0.11527727E+01
  11.60        1.70     0.16769226E+03
  11.60        0.30     0.68009662E+02
 
  11.80        5.10     0.20276050E+02
  11.80        4.00     0.55872119E+01
  11.80        3.90     0.43217667E+02
  11.80        3.40     0.18267940E+03
  11.80        3.10     0.16951660E+02
  11.80        2.50     0.17343099E+01
  11.80        2.30     0.10744622E+01
  11.80        1.90     0.15943360E+03
  11.80        0.50     0.78872025E+02

  11.90        3.50     0.17851696E+03
  11.90        3.20     0.15295699E+02
  11.90        2.60     0.19005785E+01
  11.90        2.40     0.10351484E+01
 
  12.00        5.30     0.21468003E+02
  12.00        4.20     0.48186241E+01
  12.00        0.70     0.87427232E+02
  12.00        0.20     0.59627058E-03 ..............and so on.

Below is the Gnuplot script that I used to generate the plot.

reset

   set terminal postscript eps enhanced "Helvetica" 20 color
   set output "map_data.eps"
   set size 1,1
   show label


   set size ratio 1
   set xrange [7:15]
   set yrange [0:7]
   set mytics 5
   set mxtics 5


   set iso 100
   set samp 100

   unset key
   unset sur

   set xtics scale 1
   set xtics out
   set ytics out
   set ytics scale 1

   set pm3d map 
   set palette color


   set palette rgb 33,13,10 #rainbow (blue-green-yellow-red)

   set xlabel "xlabel" font "Times-Roman,20"  rotate parallel
   set ylabel "ylabel" font "Times-Roman,20" rotate parallel



   set tics nomirror out scale 1


   set logscale cb
   set cbrange [1:2.5*1e+2]


   set view map
   set pm3d at bs 

   set dgrid3d 500,500 cauchy 0.001,0.001

   splot "con_endo_kevsph01.dat" using 1:2:3 with points palette pointsize 0.001 pointtype 5

which is generating a plot of this kind:

enter image description here where it is showing the smoothened data having magnitudes that are equal to some of my actual data points and it worries me a lot. Is there a way to control this background smoothened data to have fewer magnitudes(can lie in the blue region of the color map). I have also tried other smoothing kernels like gauss and exp but they do not have the elegance the cauchy has. Any help would be much appreciated. Thank you.

1 Answers

The smoothened background has approximately the value of the average of your data points and is therefore elevated. For the data you provided the average is 47.9 which corresponds to the greenish-orangy colour you observe.

One possibility would be to add the keyword kdensity which gives you a value of 0 (or 1 on logscale) for the background. In order to enhance the visibility you might consider using a different palette, for example a hot one. You could also vary the dx,dy of cauchy and/or scale the z value of your data to obtain better results:

set palette rgformulae 21,22,23 #hot scheme (black-red-yellow-white)
set dgrid3d 500,500 cauchy kdensity 0.01,0.01 #10 times larger than yours
splot "yourdata.dat" using 1:2:($3*1) with points palette pointsize 0.001 pointtype 5

enter image description here

Different dx,dy and scaling:

set dgrid3d 500,500 cauchy kdensity 0.001,0.001
splot "yourdata.dat" using 1:2:($3*100) with points palette pointsize 0.001 pointtype 5

enter image description here

Related