gnuplot 中 pm3d 表面上的 Splot 点 [英] Splot points over pm3d surface in gnuplot

查看:47
本文介绍了gnuplot 中 pm3d 表面上的 Splot 点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在参数模式下使用 gnuplot 绘制了一个球体.我正在尝试从一个文件中绘制 3d 数据,该文件将围绕球体.与球体重叠的点似乎被隐藏了,即使它们应该在形状的前面.

这是我的脚本:

未设置边框未设置颜色框取消设置键未设置抽动设置视图相等设置 isosamples 64设置 pm3d depthorder 插值 0,0设置调色板 rgb 3,3,3设置参数r = 19splot 'saturn.txt' linecolor rgb 'black', 
*sin(u)*cos(v) + 40, r*sin(u)*sin(v) + 40, r * cos(u) + 40.5 w pm3d

:

设置 hidden3d 前面

为什么这有效对我来说是个谜.我在 gnuplot 手册中找不到任何相关内容.

这是最终的情节:

I have plotted a sphere using gnuplot in parametric mode. I am trying to plot 3d data from a file, which will surround the sphere. It seems that the points with overlap with the sphere are hidden even though they should be in front of the shape.

Here's my script:

unset border
unset colorbox
unset key
unset tics

set view equal
set isosamples 64

set pm3d depthorder interpolate 0,0
set palette rgb 3,3,3

set parametric
r = 19

splot 'saturn.txt' linecolor rgb 'black', 
r*sin(u)*cos(v) + 40, r*sin(u)*sin(v) + 40, r * cos(u) + 40.5 w pm3d

Here is the data file, saturn.txt on pastebin

The image below shows my problem. On the left is the full set of data plotted without the sphere. In the middle it can be seen that there are points missing from in front of the sphere. The view on the right shows that these points are definitely in front of the sphere. Is there any way I can plot both at the same time without the points in front of the sphere being hidden?

解决方案

I found the answer, in this gnuplotting article:

set hidden3d front

Why exactly that works is a mystery to me. I couldn't find anything relevant in the gnuplot manual about it.

Here's the final plot:

这篇关于gnuplot 中 pm3d 表面上的 Splot 点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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