如何使用 Group 和 By 变量在拟合曲线平台的框架中插入文本(JMP 18)大家好!
我想通过 JSL(JMP 18)使用 Group 和 By 变量在拟合曲线平台的框架中插入文本。
因此我尝试了以下代码,但它不起作用:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
obj = dt << Fit Curve(Y(:weight), X(:height), Group(:sex), Fit Linear, By(:age));
robj = obj << report;
(robj << XPath(
"(//OutlineBox[text()='Fit Curve']//OutlineBox[text()='age=12']//OutlineBox[text()='Linear']//OutlineBox[text()='Plot']//FrameBox)[2]"
)) << Add Graphics Script( 1, Description( "Script" ), Text( {52, 120}, "F 12" ) );我使用模式:XPath 和根:窗口从框架的属性中复制了 XPath。
在 JMP 17 中,可以使用以下代码:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
obj = dt << Fit Curve(Y(:weight), X(:height), Group(:sex), Fit Linear, By(:age));
robj = obj << report;
<BR />(robj << XPath( "(//OutlineBox[text()='Fit Curve age=12']//OutlineBox[text()='Linear']//OutlineBox[text()='Plot']//FrameBox)[2]" )) <<
Add Graphics Script( 1, Description( "Script" ), Text( {52, 120}, "F 12" ) );对于拟合曲线年龄=12,结果应如下所示(来自 JMP 17 的屏幕截图):

非常感谢您的帮助!
自动化和脚本回复:如何使用 Group 和 By 变量在拟合曲线平台的框架中插入文本(JMP 18)我很可能会使用您获得的平台列表并循环遍历它(除非您希望在同一位置的每个框架框中都有完全相同的文本,那么我可能会使用 XPath 和报告的顶层)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
fcs = dt << Fit Curve(Y(:weight), X(:height), Group(:sex), Fit Linear, By(:age));
reports = fcs << report;
For Each({cur_report}, reports,
//cur_report = reports[1];
Try(
cur_report[Outline Box("Linear"), OutlineBox("Plot"), FrameBox(2)] << Add Graphics Script(1,
Text({52, 120}, "F 12")
);
,
Write("\!NIssue with ", cur_report << get title, "\!N", exception_msg);
);
);
回复:如何使用 Group 和 By 变量在拟合曲线平台的框架中插入文本(JMP 18)嗨,jthi,
非常感谢您的回复。请让我澄清一下我的问题:
您的脚本在每个包含女性数据的框架框中插入“F12”,但我需要在每个具有线性拟合的框架框中插入特定的文本。
我认为这可以通过使用“reports [1]”、“reports [2]”等代替“cur_report”并且不用“For Each...”函数来实现。
为什么您使用“Try”和潜在错误消息而不是 Eval?什么原因会导致图形脚本插入失败?
回复:如何使用 Group 和 By 变量在拟合曲线平台的框架中插入文本(JMP 18)您的示例向每个框架框添加了相同的文本,所以我也做了相同的操作(因为我不知道您想添加什么)。如果报告没有拟合曲线,则添加图形脚本将失败,例如,观察结果可能太少。
回复:如何使用 Group 和 By 变量在拟合曲线平台的框架中插入文本(JMP 18)现在 I 理解, 感谢 你 为了 这 解释 和 为了 你的 支持!