Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gnuplot-在二维等高线图上绘制数据点_Gnuplot_Heatmap_Contour - Fatal编程技术网

Gnuplot-在二维等高线图上绘制数据点

Gnuplot-在二维等高线图上绘制数据点,gnuplot,heatmap,contour,Gnuplot,Heatmap,Contour,我想将一些数据点()绘制到二维轮廓投影上(由上的数据生成) 我在这些帖子上找到了类似的答案:, ,但不幸的是,在我的情况下,这些似乎不起作用 首先,我设置选项: set pm3d explicit unset surface # Switch off the surface set view map # Set a bird eye (xy plane) view set contour # Plot contour lines set

我想将一些数据点()绘制到二维轮廓投影上(由上的数据生成)

我在这些帖子上找到了类似的答案:, ,但不幸的是,在我的情况下,这些似乎不起作用

首先,我设置选项:

set pm3d explicit   
unset surface     # Switch off the surface    
set view map      # Set a bird eye (xy plane) view    
set contour       # Plot contour lines    
set key outside    
set cntrparam cubicspline   # smooth out the lines    
unset colorbox
然后我用splot命令绘图:

splot 'Contours.txt' using 1:2:3 notitle with pm3d,\
      'M_Coord_Plain.txt' with points nocontour using 1:2:(0) pt 7

生成的绘图仅为轮廓二维投影,但没有点,也没有错误。

最后它成功了,但必须进行以下更改:

  • 在点数据文件(M_Coord_Plain.txt)中的每一行之间包含一个空格,因为splot命令需要这种格式
  • 删除“取消设置曲面”命令并将其替换为“设置曲面”命令,因为数据点打印在曲面上。但是,由于零值对应的颜色(定义的第三列:(0))默认为深紫色,因此这会导致点看起来模糊
  • 因此,我们可以使用黑白调色板,并定义一个大范围的颜色框范围,以便在零和高轮廓值之间有一个大的对比度
  • 因此,绘制所需绘图的命令如下:

    set pm3d explicit
    set surface
    set view map  # Set a bird eye (xy plane) view
    set contour  # Plot contour lines
    set key outside
    set cntrparam cubicspline  # Smooth out the lines
    set cntrparam levels discrete 3.197,3.552  # Plot the selected contours
    unset colorbox
    set cbrange [0:7000]  # Set the color range of contour values.
    set palette model RGB defined ( 0 'white', 1 'black' )
    set style line 1 lc rgb '#4169E1' pt 7 ps 2
    splot 'Contours.txt' using 1:2:3 with pm3d notitle,\
          'M_Coord_Plain.txt' using 1:2:(0) with points ls 1 notitle
    

    结果图是。

    如何在Gnuplot 5.4.1中重现此示例我得到警告:无法等高线非网格数据。请使用“设置dgrid3d”。