在 gnuplot 中绘制 3D 螺旋线和球体
Drawing a 3D helix and spheres in gnuplot
我正在尝试生成一个与这个非常相似的对象(至少是螺旋线和点):
绘制螺旋线的公式是这样的:
现在假设我取 a = 1 和 R = 1。
我试过像这样使用 gnuplot:
splot [t=-20:20] cos(t), sin(t), t
这是一个好的开始,我需要找到正确的 a 和 R 设置或更改显示的轴。
如何将给定坐标上的小球体添加到同一绘图中?说:
(0,1,1) -> size 0.2
(1,1,2) -> size 0.1
基于链接站点的组合,您可以叠加 individual symbols onto your plot, draw arrows for the lines and place labels。
对于符号,使用例如
预定义线条样式
set style line 1 lc rgb 'blue' pt 7
送你一个蓝圈。 Different symbol sizes can be set with the ps
command.
通过调用 splot
,您可以告诉 gnuplot 使用标准输入 ('-'
)。必须对每个符号重复此操作:
'-' w p ls 1
会给你一个由ls 1
定义的符号的点。对不同的符号使用不同的 ls
定义。
在splot
命令后,需要定义每个符号的坐标,然后e
结束输入。
在这个例子中,我们有两个点,一个在 1. 0. 0.
,一个在 -1. 0. 9.42
使用set arrow
和set label
有连接线和标签。
您可以将所有这些组合到一个脚本中:
set parametric
unset key
set style line 1 lc rgb 'blue' pt 7
set style line 2 lc rgb 'red' pt 7
set style line 3 lc rgb 'green' pt 7
splot [t=0:3*pi] cos(t),sin(t),t, '-' w p ls 1, '-' w p ls 2
1. 0. 0.
e
-1. 0. 9.42
e
p1 = 3.*pi
set arrow from 1,0,0 to -1,0,p1 nohead ls 3
set label 'A' at -1.1,-0.1,9.52
此示例将导致:
我正在尝试生成一个与这个非常相似的对象(至少是螺旋线和点):
绘制螺旋线的公式是这样的:
现在假设我取 a = 1 和 R = 1。
我试过像这样使用 gnuplot:
splot [t=-20:20] cos(t), sin(t), t
这是一个好的开始,我需要找到正确的 a 和 R 设置或更改显示的轴。
如何将给定坐标上的小球体添加到同一绘图中?说:
(0,1,1) -> size 0.2
(1,1,2) -> size 0.1
基于链接站点的组合,您可以叠加 individual symbols onto your plot, draw arrows for the lines and place labels。
对于符号,使用例如
预定义线条样式set style line 1 lc rgb 'blue' pt 7
送你一个蓝圈。 Different symbol sizes can be set with the
ps
command.通过调用
splot
,您可以告诉 gnuplot 使用标准输入 ('-'
)。必须对每个符号重复此操作:'-' w p ls 1
会给你一个由
ls 1
定义的符号的点。对不同的符号使用不同的ls
定义。在
splot
命令后,需要定义每个符号的坐标,然后e
结束输入。
在这个例子中,我们有两个点,一个在1. 0. 0.
,一个在-1. 0. 9.42
使用
set arrow
和set label
有连接线和标签。
您可以将所有这些组合到一个脚本中:
set parametric
unset key
set style line 1 lc rgb 'blue' pt 7
set style line 2 lc rgb 'red' pt 7
set style line 3 lc rgb 'green' pt 7
splot [t=0:3*pi] cos(t),sin(t),t, '-' w p ls 1, '-' w p ls 2
1. 0. 0.
e
-1. 0. 9.42
e
p1 = 3.*pi
set arrow from 1,0,0 to -1,0,p1 nohead ls 3
set label 'A' at -1.1,-0.1,9.52
此示例将导致: