<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Add text annotation on the Graph Builder in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881515#M104569</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/*""" 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 &amp;lt;&amp;lt; Get Rows Where(:Ret == curret);
	tri = Triangulation(X(dt[r, "X"], dt[r, "Y"]));
	path = tri &amp;lt;&amp;lt; 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 &amp;lt;&amp;lt; 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)] &amp;lt;&amp;lt; 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));
		);
	));
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could potentially move the loop inside graphic script and not create looped scripts (I haven't tested which would be better).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Added image of the final solution&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1750937817604.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77420i8CE47611696348C9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1750937817604.png" alt="jthi_0-1750937817604.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jun 2025 11:37:21 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-06-26T11:37:21Z</dc:date>
    <item>
      <title>Add text annotation on the Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881471#M104563</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;Is there a way to write a graphics script to add text annotation to each reticles on the wafer map?&amp;nbsp;&lt;BR /&gt;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?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TIA&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 19:58:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881471#M104563</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2025-06-25T19:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Add text annotation on the Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881484#M104565</link>
      <description>&lt;P&gt;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?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use graphic script to add the text annotation&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Current Data Table();

gb = dt &amp;lt;&amp;lt; 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)] &amp;lt;&amp;lt; Add Graphics Script(
	For(i = 1, i &amp;lt;= 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]);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1750864277796.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77344i9F7420083FC5F810/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1750864277796.png" alt="jthi_0-1750864277796.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 15:11:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881484#M104565</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-25T15:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Add text annotation on the Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881485#M104566</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I have tried the shap map, but it slows down JMP because I have 1 million rows.&lt;/P&gt;
&lt;P&gt;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&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 15:16:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881485#M104566</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2025-06-25T15:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Add text annotation on the Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881491#M104567</link>
      <description>&lt;P&gt;You can do something like this&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1750867661012.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77346i4C8C910FD4315039/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_1-1750867661012.png" alt="jthi_1-1750867661012.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;or maybe with a heatmap&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_3-1750867738277.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77348i24DB0C7939D6B6CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_3-1750867738277.png" alt="jthi_3-1750867738277.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 16:09:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881491#M104567</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-25T16:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Add text annotation on the Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881493#M104568</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;This looks great. Can you share the code?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 16:34:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881493#M104568</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2025-06-25T16:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add text annotation on the Graph Builder</title>
      <link>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881515#M104569</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/*""" 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 &amp;lt;&amp;lt; Get Rows Where(:Ret == curret);
	tri = Triangulation(X(dt[r, "X"], dt[r, "Y"]));
	path = tri &amp;lt;&amp;lt; 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 &amp;lt;&amp;lt; 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)] &amp;lt;&amp;lt; 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));
		);
	));
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could potentially move the loop inside graphic script and not create looped scripts (I haven't tested which would be better).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Added image of the final solution&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1750937817604.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77420i8CE47611696348C9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1750937817604.png" alt="jthi_0-1750937817604.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 11:37:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-text-annotation-on-the-Graph-Builder/m-p/881515#M104569</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-26T11:37:21Z</dc:date>
    </item>
  </channel>
</rss>

