简体   繁体   English

gnuplot等高线图细节

[英]gnuplot contour plot detail

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. 因此,我有一个包含3列(和40000行)的文件。第一列是x坐标,第二列是y坐标,第三列是“多少”,我想从该文件生成轮廓图。 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: [ 但是最终结果的分辨率非常低:[ 在此处输入图片说明 ] ]

I tried tweaking the line "set dgrid3d 100,100,4" but it doesn't really do much. 我尝试调整“ set dgrid3d 100,100,4”这一行,但实际上并没有做太多。 Any help? 有什么帮助吗? The end result should be like this: 最终结果应如下所示:

在此处输入图片说明

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"

You can try changing the isosamples parameter on your code: 您可以尝试在代码上更改isosamples参数:

set pm3d map
set multiplot layout 2,1

set isosamples 10
splot x*y

set isosamples 100
splot x*y

This results in: 结果是:

在此处输入图片说明

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. 当然,您始终会受到基础数据采样的限制,但是通过更改isosamples采样,也许您可​​以更接近显示的原始图。

More info here and here . 更多信息在这里这里 Hope it helps! 希望能帮助到你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM