尝试使用与 Windows 上的 gnuplot 相同的脚本在 Mac 上绘制轮廓

发布于 2025-01-14 07:02:22 字数 414 浏览 1 评论 0原文

我在 Mac 上使用 gnuplot 时遇到问题。在 Windows 上,一切看起来都很好,我可以轻松地在“热图”上绘制轮廓。但在我的 Mac 上,使用相同的脚本,我可以绘制地图,但不能绘制其顶部的轮廓。

https://i.sstatic.net/70j58.jpg 这是两张图片。一张带有轮廓的在 Windows 上,另一张在 Mac 上。

https://justpaste.it/6ws4h 这是脚本。

我尝试了 grid3d,但它们似乎不像我在 Windows 上绘制的那样准确。

I have an issue with gnuplot on Mac. On windows everything seems fine I can easily draw contours on a "heat map". But on my Mac using the same script I can plot the map but not the contours on top of it.

https://i.sstatic.net/70j58.jpg here is the two images. One with the contours is on Windows, other one is on Mac.

https://justpaste.it/6ws4h and here is the script.

I tried grid3d but they seem like not nearly accurate as the ones I have plotted on windows.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

弥繁 2025-01-21 07:02:22

我无法解释你的两台机器之间的区别,但我想我可以看到问题出现在哪里。脚本中的以下几行与生成显示曲面和轮廓的绘图不一致:

set style data pm3d
set style function pm3d
set pm3d explicit at b
splot DATA with pm3d        # command simplified

问题是默认样式和显式绘图命令都指定 pm3d,它是一个填充区域曲面阴谋。但轮廓需要用线或标签来绘制。您需要默认值和显式样式的某种组合,以允许您混合曲面和线条。我认为其中任何一个都可以解决问题:

set pm3d explicit
set style data lines
splot DATA with pm3d

或者

set pm3d implicit
splot DATA with lines

I cannot explain the difference between your two machines, but I think I can see where the problem arises. The following lines from your script are inconsistent with producing a plot with both a surface and contours shown:

set style data pm3d
set style function pm3d
set pm3d explicit at b
splot DATA with pm3d        # command simplified

The issue is that both the default style and the explicit plot command specify pm3d, which is a filled-area surface plot. But contours need to be drawn with lines or with labels. You need some combination of defaults and explicit styles that allows you to mix both a surface and lines. I think either of these would do the trick:

set pm3d explicit
set style data lines
splot DATA with pm3d

or

set pm3d implicit
splot DATA with lines
面犯桃花 2025-01-21 07:02:22

出色地!我会回答我自己的问题。

set pm3d map 
set contour surface 
set cntrparam ... 
sp "DATA" u 1:2:3  with pm3d lw 2,"" u 1:2:3 with lines nosurf

解决了我的问题。!

Well! I will answer my own question.

set pm3d map 
set contour surface 
set cntrparam ... 
sp "DATA" u 1:2:3  with pm3d lw 2,"" u 1:2:3 with lines nosurf

Solved my problem.!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文