【问题标题】:How to make a movie in Igor with one graph of multiple traces如何在 Igor 中使用一个多轨迹图制作电影
【发布时间】:2022-08-03 21:47:37
【问题描述】:

我正在 Igor 上运行一个程序,我想创建一个函数,该函数可以制作以顺序方式绘制的轨迹电影。该程序生成一个在 x 轴和 y 轴之间交换的波表,例如,

Point Time0 Data0 Time1 Data1
1 5.3860002 14518253 5.3829999 15511268
2 5.4910002 13881730 5.487 15299764

该程序允许我为尽可能多的波浪创建此图表/表格。目前,我通过调用制作电影

\'\'\'
NewMovie
AddMovie Frame
//Make a new graph
AddMovie Frame
//Make a new graph
AddMovie Frame
//Make a new graph
//etc etc
CloseMovie
\'\'\'

这显然非常乏味,所以我正在尝试制作它,这样我就可以制作一个包含许多波浪的图表/表格,然后用每个波浪更新一个新图表并循环 NewMovie 直到它完成。

下面的代码是为类似的东西制作的,但我不能让它适用于双浮点数据集,这就是我所拥有的——不是矩阵。我也无法弄清楚如何以上表所示的方式(即每隔一个)调用波浪。任何帮助或提示都可以接受。 \'\'\'

Function MakeMovie(matrix,xWave)
Wave matrix,xWave
variable i //loop variable
//make a dummy wave to accept individual rows
Make/O/N=(dimsize(matrix,1)) framewave
//create the first frame of the movie in a Graph windows called \"FrameGraph\"
Display/N=FrameGraph framewave vs xWave
Label/W=FrameGraph left \"Intensity (a.u.)\"
Label/W=FrameGraph bottom \"Wavelength (nm)\"
WaveStats/Q matrix //Get statistics of matrix
//set axis to a constant to prevent autoscaling
SetAxis left V_min,1.1*V_max
//Name the movie after the original wave
String movieName = NameofWave(matrix) + \".mov\"
//create a new movie with the original wave\'s name
NewMovie /F=30/L/I/O as movieName
//start loop to add frames to movie
for (i = 0; i < dimsize(matrix,0);i += 1)
framewave=matrix[i][p] //advance to the next trace in the sequence
DoUpdate //update the graph with the next trace in the sequence
AddMovieFrame //add a frame to the movie
endfor
CloseMovie //Close the movie file and save it to disk.
Killwindow FrameGraph //clean up
Killwaves framewave //clean up
End
\'\'\'

    标签: igor


    【解决方案1】:

    请将您的代码包装在代码标签中并缩进以提高可读性。 Igor Pro 通过选择代码并选择 Edit->Adjust Indentation 来做到这一点。

    关于你的问题。以下工作在这里:

    Make/O/N=(75, 100) matrix = p + q
    Make/O/N=(100) xwave = 0.1 * p
    MakeMovie(matrix, xWave)
    

    矩阵中的行维度给出了帧数,其中列保存了每个跟踪的数据。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-01
      • 2020-05-07
      • 1970-01-01
      • 2013-01-11
      • 2017-01-18
      • 1970-01-01
      相关资源
      最近更新 更多