0

So, I have a file with 3 columns (and 40000 rows), .First column is x coordinate, second is the y coordinate and 3rd column is "how many" and I want to produce a contour plot from this file. I searched around and I managed to make it work with a solution from another post. But the ending result is of really low resolution: [enter image description here]

I tried tweaking the line "set dgrid3d 100,100,4" but it doesn't really do much. Any help? The end result should be like this:

enter image description here

EDIT: Code I'm using

set contour
unset surface
set cntrparam levels incr 0.0,0.1,1.0

set view map
set xrange [0:30]
set yrange [0:30]

set dgrid3d 100,100,4

set table "contour.txt"
splot 'this.txt'
unset table

unset contour
set surface
set table "dgrid.txt"
splot 'this.txt'
unset table

reset
set pm3d map
unset key
set palette defined (0 '#352a87', 1 '#0363e1',2 '#1485d4', 3 '#06a7c6', 4 '#38b99e', 5 '#92bf73', 6 '#d9ba56', 7 '#fcce2e', 8 '#f9fb0e')
set autoscale fix
set grid

splot 'dgrid.txt' w pm3d, 'contour.txt' w l lc rgb "black"
Monochromatic
  • 172
  • 13

1 Answers1

1

You can try changing the isosamples parameter on your code:

set pm3d map
set multiplot layout 2,1

set isosamples 10
splot x*y

set isosamples 100
splot x*y

This results in:

enter image description here

Of course, you're always limited by the sampling of your underlying data, but by changing the isosamples maybe you can get closer to the original plot you showed.

More info here and here. Hope it helps!

Vinicius Placco
  • 1,683
  • 2
  • 14
  • 24
  • I updated my question with the code I'm using. Where's should I put the command "set isosamples 100", I've tried it and it doesn't change anything. Number of points are 40000. This is not the problem, because I can make contour plots with another software and graph is fine (using the same file), in terms of resolution. – Monochromatic Mar 09 '19 at 16:38
  • What happens if you just do `set pm3d map; set isosamples 100; splot "this.txt"` then change the isosamples? – Vinicius Placco Mar 11 '19 at 14:23