使用dgrid3d时gnuplot忽略x和y范围 [英] gnuplot ignores x and y ranges when using dgrid3d

查看:55
本文介绍了使用dgrid3d时gnuplot忽略x和y范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含分散数据的文件(点大约位于规则网格的顶点上):前两列是x和y坐标,然后是其他几列以及需要绘制的其他数据.我想获取表示此数据的颜色图,由于点是分散的,因此我使用 dgrid3d 生成规则的网格并具有更平滑的表示.我的问题是,当我设置 dgrid3d 时,gnuplot会忽略x和y范围,并在图形框架之外绘制网格.波纹管是重现我的问题的最小脚本:

I have a file with scattered data (points located approximatelly on the vertices of a regular grid): first two columns are the x and y coordinates, then a few more columns with other data that I need to plot. I want to obtain color maps that represent this data, and since points are scattered I'm using dgrid3d to generate a regular grid and have a smoother representation. My problem is that when I set dgrid3d, gnuplot ignores the x and y ranges and plot the grid outside the figure frame. Bellow is a minimal script to reproduce my problem:

set view map
set yrange [0.4:0.8]
set xrange [0.2:0.8]
set pm3d 
set style data lines
set dgrid3d 100,100,4
splot "./Terr.dat" using 1:2:(log($6)) pal

我得到的结果如下图:

The result that I obtain is the following image:

设置 pm3d 的选项 clip1in clip4in 无效.如果我未设置视图,以使结果为3D曲面,则它还将忽略x和y范围.我可以轻松地编写脚本来预处理数据并删除所需范围之外的点,但是 gnuplot 应该可以管理它.有什么主意吗?

Setting the option clip1in or clip4in of pm3d has no effect. If I unset view so that the result is a 3D surface, it also ignores the x and y ranges. I could easily write an script to pre-process the data and remove the points outside the range I want, but gnuplot should be able to manage this. Any idea?

我正在使用 gnuplot 4.2补丁程序级别6

谢谢!

推荐答案

我不确定我能否重现您的问题,但是您的脚本中有一些有趣的事情.我不确定在您使用pm3d进行绘制时在此上下文中线set style data lines应该做什么.我创建了一个简单的数据文件:

I'm not sure that I am able to reproduce your problem, but there are a few funny things with your script. I'm not exactly sure what the line set style data lines is supposed to do in this context as you're plotting with pm3d. I created a simple datafile:

0 1 4
1 0 5
0 0 2
1 1 3

我使用以下脚本对其进行了绘制:

And I plotted it using this script:

set view map
set yrange [0.4:0.8]
set xrange [0.2:0.8]
set dgrid3d 100,100,4
splot 'test.dat' u 1:2:3 w pm3d

而且似乎起作用"了(我使用的是gnuplot 4.6.0).

And it seemed to "work" (I'm using gnuplot 4.6.0).

但是,有一些注意事项-请注意,我原始域中的每个点都超出了给定的x和y范围. Gnuplot在构造曲面时仍使用这些点.这也很好地证明了gnuplot加权函数的外观(尽管我们可以通过在数据文件中仅使用1点来做得更好.)

There are a few things of note however -- Notice that every point in my original domain was out of the given x and y ranges. Gnuplot still used those points when constructing the surface. This is also demonstrates reasonably nicely what the gnuplot weighting function looks like (although we could do even better by using only 1 point in our data file.)

在两台计算机之间,我可以访问gnuplot4.2.6,gnuplot4.3.0,gnuplot4.4.2,gnuplot4.6.0,gnuplot4.6.1和gnuplot4.7.0. gnuplot4.2.6是仅用于显示您所描述行为的仅版本.在我看来,他们在4.3 CVS分支中更改了pm3d的行为,但没有将这些更改推回到gnuplot4.2中.简单的解决方法是升级到gnuplot4.6-我已经将它用作默认的gnuplot已有几个月了,它似乎非常稳定.

Between my 2 computers, I have access to gnuplot4.2.6, gnuplot4.3.0, gnuplot4.4.2, gnuplot4.6.0, gnuplot4.6.1 and gnuplot4.7.0. gnuplot4.2.6 is the only version which exhibits the behavior you describe. It looks to me like they changed the behavior of pm3d in the 4.3 CVS branch, but didn't push those changes back into gnuplot4.2. The easy fix is to upgrade to gnuplot4.6 -- I've been using it as my default gnuplot for a few months now and it seems to be pretty stable.

这篇关于使用dgrid3d时gnuplot忽略x和y范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆