您好,我對 JMP 很陌生,有一個問題:是否可以保存動畫?
例如,如果我在某個表上按 X 擬合 Y,然後使用數據過濾器動畫。 可以保存動畫/剪輯嗎?
謝謝!
您可以在此處找到使用數據過濾器保存動畫 GIF 的另一個示例:將數據過濾器動畫另存為動畫 GIF 。
如果您在 Windows 上使用 JMP 13,則可以使用新的 JSL 功能創建動畫 GIF 來保存數據過濾器動畫。
下面的示例將使用本地數據過濾器創建圖形生成器,並保存和打開動畫 GIF。 欲了解更多信息,請查看@約翰·龐特的關於使用氣泡圖製作動畫 GIF 的帖子。 我在下面的腳本中藉用了他的颶風示例中的大量代碼。 理論上,如果您運行以“report = Current Report()”行開頭的所有內容,則這可以在您打開的當前窗口上運行。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
gb = dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Local Data Filter(
Add Filter(
columns( :age ),
Where( :age == 12 ),
Display( :age, Size( 202, 114 ), List Display )
)
)
);
report = Current Report();
ldf_listBox = report[ListBoxBox(1)];
numLevels = NItems(ldf_ListBox << Get ITems);
// Create a new image, same size as the graph we are going to capture
graphFrame = report[FrameBox(1)] << getPicture();
{w, h} = graphFrame << getSize();
img = newImage(w, h);
for(i=1,i<=numLevels,i++,
// deselect old selection
selectedItems = ldf_listBox << Get Selected Indices;
for(k=1,k<=nitems(selectedItems),k++,
ldf_listBox << set selected(selectedItems[k],0);
);
// set the next item selected
ldf_listBox << set selected(i);
wait(0); // wait for the display to update
// Capture frame for current graph and save to animated image
graphFrame = report[FrameBox(1)] << getPicture();
{r, g, b} = graphFrame << getPixels("rgb");
img << addFrame();
img << setFrameDuration(1000); // Time between frames, in ms
img << setPixels("rgb", {r, g, b});
wait(0.5); // for demonstration purposes
);
// Remove inital blank frame
img << removeFrame(0);
// Write out animated image
img << saveImage ("$temp\animated.gif", gif);
// open the gif
open("$temp\animated.gif");
編輯添加生成的 GIF 文件:
Resulting animated gifResulting animated gif生成的 gif 動畫