/*""" Reticle outline and names
Author: jthi
Creation Date: 2025-06-25
Creation JMP Version: JMP Pro 18.2.0
"""*/
Names Default To Here(1);
dt = Open("$DOWNLOADS/dataTable.jmp");
Summarize(dt, rets = By(:Ret));
aa = Associative Array();
For Each({curret}, rets,
r = dt << Get Rows Where(:Ret == curret);
tri = Triangulation(X(dt[r, "X"], dt[r, "Y"]));
path = tri << Get Hull Path;
aa[curret] = Associative Array();
aa[curret]["Path"] = path;
aa[curret]["X"] = Median(dt[r, "X"]);
aa[curret]["Y"] = Median(dt[r, "Y"]);
);
gb = dt << Graph Builder(
Size(937, 542),
Show Control Panel(0),
Variables(X(:X), Y(:Y), Color(:"%Fail"n)),
Elements(Points(X, Y, Legend(10)))
);
For Each({{retname, param}}, aa,
Eval(EvalExpr(
Report(gb)[FrameBox(1)] << Add Graphics Script(
Pen Color("Red"); // outline color for reticles
Pen Size(3); // reticle outline size
Path(Expr(param["Path"]), 0); // plots reticle outline
Text Color("Black"); // text color
Text Size(10); // text size for reticle
Pen Color("Black"); // text box outline color
Pen Size(2); // outline size for text box
Text(Boxed, Erased, Center Justified, {Expr(param["X"]), Expr(param["Y"])}, Expr(retname));
);
));
);
You could potentially move the loop inside graphic script and not create looped scripts (I haven't tested which would be better).
Edit: Added image of the final solution

-Jarmo