大家好,
在創建了大約 30 個圖表的動態變異性圖表後,我的腳本遇到了問題,但想要將少量資料子集到另一個視窗中,但無法這樣做。對於公司政策,我無法發布程式碼,但使用了我嘗試使用 JMP 範例資料執行的操作的範例,如下所示。
dt = Open("C:\Program Files\SAS\JMP\17\Samples\Data\Quality Control\Braces.jmp");
vc = Variability Chart(
Y( :"# defects"n ),
Model( "Main Effect" ),
X( :Date ),
Variability Analysis(
:"# defects"n,
Show Range Bars( 0 ),
Show Cell Means( 0 ),
Std Dev Chart( 0 )
),
By( :Unit size )
);
subset_vc = New Window("Only some vc", vlis = V List Box());
frameboxes_to_subset = {1, 3, 5}; // Want to get when unit size = 4, 8, 12
vc_rpt = vc << Report;
show(N Items( (vc_rpt << XPath( "//FrameBox" )) ));
structure = vc_rpt << Show tree structure;
for(i = 1, i <= N Items(frameboxes_to_subset), i++,
vlis << append(vc_rpt[FrameBox(frameboxes_to_subset[i])]);
);我可以在日誌中看到原始 vc_rpt 按預期有 6 個 Framebox,但是當我嘗試根據“顯示樹結構”中看到的 Framebox 編號對它們進行子集化時,沒有附加任何圖表。我還嘗試將其包裝在額外的 V 列錶框中,類似地,沒有任何內容可以添加到新視窗中。任何幫助將不勝感激。謝謝!
謝謝吉姆,
有趣的是,我會閱讀這一點,因為我認為一個視窗代表日記的“一頁”,因此只有一個。感謝您的幫忙!
您的錯誤在於認為所有圖像都在一份報告中。相反,有 6 份報告,每份報告都有一張圖片。
因此,您的程式碼需要更改為循環指定的報告並從每個報告中抓取framebox(1)。
dt = Open("C:\Program Files\SAS\JMP\17\Samples\Data\Quality Control\Braces.jmp");
vc = Variability Chart(
Y( :"# defects"n ),
Model( "Main Effect" ),
X( :Date ),
Variability Analysis(
:"# defects"n,
Show Range Bars( 0 ),
Show Cell Means( 0 ),
Std Dev Chart( 0 )
),
By( :Unit size )
);
subset_vc = New Window("Only some vc", vlis = V List Box());
frameboxes_to_subset = {1, 3, 5}; // Want to get when unit size = 4, 8, 12
vc_rpt = vc << Report;
//show(N Items( (vc_rpt << XPath( "//FrameBox" )) ));
//structure = vc_rpt << Show tree structure;
for(i = 1, i <= N Items(frameboxes_to_subset), i++,
vlis << append(vc_rpt[frameboxes_to_subset[i]][FrameBox(1)]);
);

我也認為您可能不想只拉 FrameBox(),而是拉動 PictureBox()

subset_vc = New Window("Only some vc", vlis = V List Box());
frameboxes_to_subset = {1, 3, 5}; // Want to get when unit size = 4, 8, 12
vc_rpt = vc << Report;
//show(N Items( (vc_rpt << XPath( "//FrameBox" )) ));
//structure = vc_rpt << Show tree structure;
for(i = 1, i <= N Items(frameboxes_to_subset), i++,
vlis << append(vc_rpt[frameboxes_to_subset[i]][PictureBox(1)]);
);