cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
Jackie_
Level VI

Add text annotation on the Graph Builder

Hello,
Is there a way to write a graphics script to add text annotation to each reticles on the wafer map? 
Additionally, I want to color two columns - 'Ret' and '%Fail', create a heat map with %Fail col and overlay Ret col. Is this possible on GB?


 

TIA

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Add text annotation on the Graph Builder

/*""" 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

jthi_0-1750937817604.png

 

-Jarmo

View solution in original post

5 REPLIES 5
jthi
Super User

Re: Add text annotation on the Graph Builder

How would you color with two columns in this case? Reticle would define the main color and %Fail the gradient or something similar? Have you considered creating shape map file for this type of analysis?

 

You can use graphic script to add the text annotation

Names Default To Here(1);

dt = Current Data Table();

gb = dt << Graph Builder(
	Size(979, 588),
	Variables(X(:X), Y(:Y), Overlay(:Ret)),
	Elements(Points(X, Y, Legend(10)), Smoother(X, Y, Legend(11)))
);

Summarize(dt, rets = By(:Ret), mx = Mean(:X), my = Mean(Y));

// Lazy option without evaluation
Report(gb)[FrameBox(1)] << Add Graphics Script(
	For(i = 1, i <= N Items(rets), i++,
		Text Color("Black");
		Text Size(12);
		Pen Color("Black");
		Pen Size(3);
		Text(Boxed, Erased, Center Justified, {mx[i], my[i]}, rets[i]);
	);
);

jthi_0-1750864277796.png

 

-Jarmo
Jackie_
Level VI

Re: Add text annotation on the Graph Builder

Hi @jthi ,

I have tried the shap map, but it slows down JMP because I have 1 million rows.

I was thinking if there's a way to draw the border around the reticles using graphic script, I can border those reti on wafer map and this will let me distinguish the reticles, and then I can add %Fail to the color selection on the legend

 

Thanks,

jthi
Super User

Re: Add text annotation on the Graph Builder

You can do something like this

jthi_1-1750867661012.png

or maybe with a heatmap

jthi_3-1750867738277.png

 

 

 

-Jarmo
Jackie_
Level VI

Re: Add text annotation on the Graph Builder

@jthi This looks great. Can you share the code?

jthi
Super User

Re: Add text annotation on the Graph Builder

/*""" 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

jthi_0-1750937817604.png

 

-Jarmo

Recommended Articles