New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
This "problem" was presented today at JMP Scripting Users Group meeting Q3_2022.
Add option to extend Graph Builders legend to each page when Page is being used. I know this can be done by using By when launching Graph Builder from launcher but using Page is much much more flexible than using By especially if you have to make any changes to graph builder.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Probe.jmp");
// Use XPatH() and Picture Box with legend
gb = dt << Graph Builder(
Show Control Panel(0),
Size(500, 9760),
Variables(X(:DELW_NEMIT), Y(:DELL_RPNBR), Page(:Wafer Number), Color(:Process)),
Elements(Points(X, Y, Legend(5)))
);
lg = (gb << XPath("//LegendBox"))[1];
lg_pic = lg << get picture;
fbs = (gb << XPath("//FrameBox")) << parent;
Remove From(fbs, 1); // first one already has "real" legend
//margins will need to be adjusted depending on GB size
fbs << append(Picture Box(lg_pic, << Margin(Left((gb << get size)[1]-130), Top(-15), Right(0), Bottom(0))));
// Loop over groups one by one while using Where()
nw = New Window("GBs",
lub = Lineup Box(N Col(1));
);
Summarize(dt, pages = by(:Wafer Number));
For Each({page}, pages,
gb_page_expr = Expr(
Eval(EvalExpr(gb = dt << Graph Builder(
Show Control Panel(0),
Size(500, 500),
Variables(X(:DELW_NEMIT), Y(:DELL_RPNBR), Color(:Process), Group X(:Wafer Number)),
Elements(Points(X, Y, Legend(5))),
Where(:Wafer Number == Expr(page))
)));
);
lub << Append(gb_page_expr);
// gb << Title("");
);
((lub << Top Parent) << XPath("//TextBox[contains(text(), 'Where(:')]")) << Visibility("Collapse");
// most likely best idea, use By()
gbs = Graph Builder(
Size(534, 456),
Show Control Panel(0),
Variables(X(:DELW_NEMIT), Y(:DELL_RPNBR), Color(:Process)),
Elements(Points(X, Y, Legend(1))),
By(:Wafer Number)
);
Write();