GNUPLOT:绘制在球体表面上 [英] GNUPLOT: Plotting on the surface of a sphere

查看:146
本文介绍了GNUPLOT:绘制在球体表面上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个函数依赖于phi和theta,我想在一个球体的表面上绘图。
日期存储在一个带有列的.txt文件中:

I have a function dependent on phi and theta, which I want to plot on the surface of a sphere. The date is stored in a .txt file with the columns:

1: x = R*sin(theta)*cos(phi)
2: y = R*sin(theta)*sin(phi)
3: z = R*cos(theta)
4: density

我使用以下gnuplot代码来绘制:

I use the following gnuplot code to plot:

set terminal wxt size 800,800
set mapping cartesian
set view equal xyz
set xlabel 'x'
set ylabel 'y'
set zlabel 'z'
splot "densityprofile_100.000.txt" u 1:2:3:4 with pm3d
pause -1

不幸的是,Gnuplot似乎无法正确表示球体上的颜色。似乎有一些影子,我无法摆脱;看到图片在这里:

Unfortunately Gnuplot doesn't seem to be able to properly represent the colours on the sphere. There seems to be some shadow, which I can not get rid off; see the picture here:

当我用鼠标转动球体时,阴影变得越来越小,但没有完全消失的位置。
提供任何帮助。

When I turn the sphere with my mouse, the shadow gets smaller and bigger, but there is no position in which it fully disappears. Any help is appreciated.

推荐答案

通过添加以下行,找到了解决我的问题的方法:

I found the solution to my problem by adding the following line:

set pm3d depthorder

这篇关于GNUPLOT:绘制在球体表面上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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