2
votes

I am dealing with a color map but I encounter some problem. Here is my code:

set size 1,1; set origin 0,0
set grid layerdefault
set xlabel "x (rdaius)"
set ylabel "z (radius)"

set sample 11; set isosamples 11
set pm3d map
set palette
set colorbox
set lmargin 0


set pm3d flush begin
splot 'density.txt' u 1:2:3

However, there is error message:

Warning: Single isoline (scan) is not enough for a pm3d plot.

How can fix the problem?

Also, I tried using plot 'density.txt' u 1:2:3 with image, there is also error message:

Number of pixels cannot be factored into integers matching grid. N = 36759 K = 201

Note The data file density.txt is formatted as

  X       Y      N Part.
=====   =====    =====
-10.0   -10.0     10.0
-10.0    -9.9     324.0
-10.0    -9.8     256.5
-10.0    -9.7     0.0
-10.0    -9.6     32.5
-10.0    -9.5     7.8
-10.0    -9.4     66.4
 ...      ...      ...

Where x and y ranges from -10 to 10, N. Part ranges from 0.0 to ~1000.0.

Thanks!

1
I can't find this anywhere, what does N and K mean for the heatmap plot?sun

1 Answers

3
votes

You need a blank line after before you increment values in your first dimension:

#data.dat
<x1> <y1> <z11>
<x1> <y2> <z12>
<x1> <y3> <z13>
<x1> <y4> <z14>

<x2> <y1> <z21>
<x2> <y2> <z22>
<x2> <y3> <z23>
<x2> <y4> <z24>

...

<xn> <y1> <zn1>
<xn> <y2> <zn2>
<xn> <y3> <zn3>
<xn> <y4> <zn4>

You'll also need to skip over your headers with splot 'data.dat' every ::2 ...