大家好,
我创建了一个大约 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)]);
);