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

查看:37
本文介绍了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天全站免登陆