Animation 如何在gnuplot中设置坐标数据的动画?

Animation 如何在gnuplot中设置坐标数据的动画?,animation,gnuplot,Animation,Gnuplot,我有4组坐标数据(2D,假设它代表不同位置的正方形)。如何在gnuplot中设置它们的位置动画(如果其他程序更容易实现,请推荐),使其看起来像是逆时针旋转 立场1: 11 3 1 3 3 13 立场2: -1 -3 1 -3 3 -13 立场3: -1-1 -3 -1 -3 -3 -1-3 立场4: 1-1 3 -1 3 -3 1-3无论您想要填充的正方形或线条,还是动画的gif或其他东西,您都不需要编写。 你可以这样开始。确保数据由两个空行分隔,这样gnuplot将识别可以通过索引i寻址的块。

我有4组坐标数据(2D,假设它代表不同位置的正方形)。如何在gnuplot中设置它们的位置动画(如果其他程序更容易实现,请推荐),使其看起来像是逆时针旋转

立场1:

11
3 1
3 3
13

立场2:

-1
-3 1
-3 3
-13

立场3:

-1-1
-3 -1
-3 -3
-1-3

立场4:

1-1
3 -1
3 -3

1-3

无论您想要填充的正方形或线条,还是动画的
gif
或其他东西,您都不需要编写。 你可以这样开始。确保数据由两个空行分隔,这样gnuplot将识别可以通过
索引i
寻址的块。 同时检查帮助gif

代码:

### animation of square
reset session
set size square 

$Data <<EOD
# Position 1:
1 1
3 1
3 3
1 3


# Position 2:
-1 1
-3 1
-3 3
-1 3


# Position 3:
-1 -1
-3 -1
-3 -3
-1 -3


# Position 4:
1 -1
3 -1
3 -3
1 -3
EOD

set xrange [-4:4]
set yrange [-4:4]

set term gif animate delay 100 optimize
set output "tbAnimationSquare.gif"
do for [i=0:3] {
    plot $Data u 1:2 index i w filledcurves lc rgb "red" not
}
set output
### end of code
####方形动画
重置会话
定格

$Data无论您想要填充的正方形或线条,还是动画的
gif
或其他东西,都不需要写入。 你可以这样开始。确保数据由两个空行分隔,这样gnuplot将识别可以通过
索引i
寻址的块。 同时检查帮助gif

代码:

### animation of square
reset session
set size square 

$Data <<EOD
# Position 1:
1 1
3 1
3 3
1 3


# Position 2:
-1 1
-3 1
-3 3
-1 3


# Position 3:
-1 -1
-3 -1
-3 -3
-1 -3


# Position 4:
1 -1
3 -1
3 -3
1 -3
EOD

set xrange [-4:4]
set yrange [-4:4]

set term gif animate delay 100 optimize
set output "tbAnimationSquare.gif"
do for [i=0:3] {
    plot $Data u 1:2 index i w filledcurves lc rgb "red" not
}
set output
### end of code
####方形动画
重置会话
定格

$Data谢谢你,@theozh。这绝对解决了我的问题谢谢你,@theozh。这绝对解决了我的问题