时间期间沿条形的温度的 Gnuplot 动画 [英] Gnuplot animation of temperature along a bar during time

查看:20
本文介绍了时间期间沿条形的温度的 Gnuplot 动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据集由一个矩阵组成,该矩阵的列号对应于导热棒上的 20 个不同位置,第一列包含实验经过的时间.

My dataset consists of a matrix of which the column number corresponds to 20 different positions along a thermally conductive bar and the first column contains the elapsed time of the experiment.

换句话说,读取矩阵的第 j 行将按此顺序给出以下数据:
时间 t(j),位置 1 在时间 t(j) 的温度,温度.位置2 在 t(j), ... , 温度.在 t(j) 时的 pos.20.

In other words, reading the row j of the matrix would give the following data in this order:
time t(j), temperature of position 1 at time t(j), temp. of pos. 2 at t(j), ... , temp. of pos.20 at t(j).

我的目标是制作一个沿 x 轴位置的动画图,并在 y 轴上显示随时间变化的相对温度.

My goal is to produce an animated plot with positions along the x axis and displaying the relative temperatures on the y axis changing with time.

我是使用 gnuplot 的新手,非常感谢任何帮助,如果有更容易处理的形状,可以修改数据集.

I'm a newbie in using gnuplot and any help would be much appreciated, the dataset can be modified if there is a shape that's easier to deal with.

推荐答案

你的数据格式有点不寻常,因为一帧的所有数据似乎都在一行中.下面是一个可以帮助您入门的基本示例:假设您的数据文件中只有 3 个(而不是 20 个)位置,并且总共有 3 行(时间点):

You data format is a little unusual, as all data for a frame seems to be in a single row. Here is a basic example that might get you started: imagine you have only 3 (instead of 20) positions, and a total of 3 rows (time points) in your data file:

0       2       4       6
1       3       4       5
2       4       4       4

第一列是时间,第 2-4 列是温度.然后您可以使用以下脚本循环遍历每一行:

The first column is time, columns 2-4 are temperatures. Then you can use the following script to loop over each row:

Npositions = 3
Nrows = 3

set xtics 1
set xlabel "Position"
set xrange [0.2:Npositions+0.8]

set ylabel "Temperature"
set yrange [0:10]

set boxwidth 0.5 absolute
set style fill solid

do for [row=0:Nrows-1] {
   plot for [column=2:Npositions+1] "test.dat" u (column-1):column every ::row::row w boxes notitle ls 1, 
    "" u (1):(9):("Time " . stringcolumn(1)) every ::row::row with labels notitle
   pause 0.5
}

这篇关于时间期间沿条形的温度的 Gnuplot 动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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