3d 在gnuplot中使用x-y文件绘制柱坐标

3d 在gnuplot中使用x-y文件绘制柱坐标,3d,gnuplot,cylindrical,3d,Gnuplot,Cylindrical,我想使用interface.txt文件用gnuplot制作一个3D绘图。 知道我有y轴旋转不变性。 此图表示“interface.txt”u 2:1的二维剖面图 这是我想要的gnuplot,但我不知道如何绘制它。 我想得到这张图片,但θ=[0:2*pi]。 我试过这个代码,但现在我不知道如何绘制它 reset set angles degrees set mapping cylindrical splot for [t=1:360:2] 'interface.txt' u t:1:(sqrt(

我想使用interface.txt文件用gnuplot制作一个3D绘图。 知道我有y轴旋转不变性。 此图表示“interface.txt”u 2:1的二维剖面图

这是我想要的gnuplot,但我不知道如何绘制它。 我想得到这张图片,但θ=[0:2*pi]。 我试过这个代码,但现在我不知道如何绘制它

reset
set angles degrees
set mapping cylindrical

splot for [t=1:360:2] 'interface.txt' u t:1:(sqrt($2**2+$1**2))
你知道吗?
谢谢你

我不确定下面的例子是否满足您的期望。 由于原始曲线未闭合,因此这不是实体而是曲面。 为了让pm3d在旋转曲线之间进行连接,我想你必须在旋转曲线之间添加一条空线。您可以通过使用一个元素绘制一个虚拟数组的技巧来实现这一点:绘制一个uw表。我希望有更好的解决办法

代码:

结果:


谢谢你,它几乎是完美的。 现在它尝试关闭我的两个曲面。

所以我们需要连接曲线的边缘来得到一个物体。 为此,我使用统计数据:

最后的代码是:

### rotation of a curve
reset session

set print $interface
stats 'interface.txt' nooutput
print sprintf("%g %g", STATS_max_y, STATS_pos_max_y)
print sprintf("%g %g", STATS_max_y, -STATS_pos_max_y)
set angle degrees
set table $Rotation
    array A[1]   # dummy array for plotting a single empty line
    do for [i=0:360:10] {
        plot "interface.txt" u ($2*cos(i)):($2*sin(i)):1 w table
    plot "interface.txt" u ($2*cos(i)):($2*sin(i)):(-$1) w table
    plot $interface u ($1*cos(i)):($1*sin(i)):2 w table
        plot A u ("") w table
    }
unset table

unset key
set border
set style fill solid 1.00 border -1
set view 62, 8, 1.245, 1.0

set ticslevel 0
set pm3d depthorder interpolate 4,4 lighting specular 0.6 at s

# set view equal xyz   # uncomment to have equal x,y,z scales

splot $Rotation u 1:2:3 w pm3d lt -2 notitle
### end of code

您的数据是一条开放曲线。是否应该以某种方式关闭它?如果是,怎么做?是的,我想我们可以使用pm3d闭合曲线。也许有了特殊的文件名和我的数据文件,我们就可以画出这个……非常感谢!几乎完美,现在我们只需闭合两个曲面即可获得一个实体。您知道是否可以在xy平面上使用isosample和pm3d贴图添加设置等高线基础?在保持稳定的同时,我很高兴它起了作用。那么这应该是被接受的答案,我的答案很有帮助;-。请记住,使用set-print$接口创建数据块时,在创建完数据块后,请使用set-print或unset-print停止将所有内容打印到此数据块。如果要将某些内容打印到gnuplot控制台窗口。
### rotation of a curve
reset session

set print $interface
stats 'interface.txt' nooutput
print sprintf("%g %g", STATS_max_y, STATS_pos_max_y)
print sprintf("%g %g", STATS_max_y, -STATS_pos_max_y)
set angle degrees
set table $Rotation
    array A[1]   # dummy array for plotting a single empty line
    do for [i=0:360:10] {
        plot "interface.txt" u ($2*cos(i)):($2*sin(i)):1 w table
    plot "interface.txt" u ($2*cos(i)):($2*sin(i)):(-$1) w table
    plot $interface u ($1*cos(i)):($1*sin(i)):2 w table
        plot A u ("") w table
    }
unset table

unset key
set border
set style fill solid 1.00 border -1
set view 62, 8, 1.245, 1.0

set ticslevel 0
set pm3d depthorder interpolate 4,4 lighting specular 0.6 at s

# set view equal xyz   # uncomment to have equal x,y,z scales

splot $Rotation u 1:2:3 w pm3d lt -2 notitle
### end of code