<?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: How to place label next to data point in GB using JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-place-label-next-to-data-point-in-GB-using-JSL/m-p/669179#M85734</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Once again, thanks for the wonderful suggestions. This time, I ended up going with&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;'s suggestion of using the &amp;lt;&amp;lt;Add Graphics Script because it gave me a little more flexibility in how I wanted to place the text as well as putting it inside a For() loop to loop through all the peak ranks. I had vectors of the all the Period, Frequency, and Spectral Density (or Periodogram) values, so looping through was easier than searching through the table. It works great, thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; One thing to note for any others reading this thread and trying something similar, when adding multiple graphics scripts to the GB or whatever graphic, it's important that you Substitute() the actual variables so that each new text will be placed in a unique location and not just overwritten by the last Add Graphics Script. What I mean by this, is that you need to do something like the following in order to add multiple different texts to the graphic:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
	Substitute(
			Expr(
				gbframebox_1 &amp;lt;&amp;lt; Add Graphics Script( Text( Eval( {__xpos__, __ypos__} ), __gb_text__ ) );
				gbframebox_2 &amp;lt;&amp;lt; Add Graphics Script( Text( Eval( {__fpos__, __ypos__} ), __gb_text__ ) );
			),
		Expr( __xpos__ ), xpos,
		Expr( __fpos__ ), fpos,
		Expr( __ypos__ ), ypos,
		Expr( __gb_text__ ), gb_text
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; All of that needs to be within a For() loop, of course, and with each iteration you redefine what the Expr() variables are so that each added text is unique. Here, the Expr() variables start and end with two underscore characters __ (I believe I adopted this from a previous suggestion I got from&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;on handling specification parameters using JSL). Note, for me there are two frame boxes because I am plotting the same y-variable against two different x-variables using graph builder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for all your help!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
    <pubDate>Fri, 18 Aug 2023 14:38:43 GMT</pubDate>
    <dc:creator>SDF1</dc:creator>
    <dc:date>2023-08-18T14:38:43Z</dc:date>
    <item>
      <title>How to place label next to data point in GB using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-place-label-next-to-data-point-in-GB-using-JSL/m-p/668993#M85710</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Still working on improving a script I'm writing, and I've gotten a lot of help from&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;on this -- thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; One "last little thing" (there's always something to improve isn't there?). I'd like to put a number label next to the peaks that are identified when looking at the spectral density. Something similar to the Control Chart Builder when you test for warnings beyond limits and the graph puts a little circle around the data point and a small * next to it (see below).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SDF1_0-1692296335091.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55838i49870BAC18FEA660/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SDF1_0-1692296335091.png" alt="SDF1_0-1692296335091.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; But, I don't need the circle or asterisk, just the peak number (1, 2, 3, etc.) to help the user better identify the table box values and the graphical display (see mock up below, numbers highlighted in yellow are what I want to add -- highlighting just for visual ease in this post). The screenshot is the actual interface window from the script -- but without the added text boxes in the graph builder panel. I have an idea of how to build the list of numbers, that's not a problem, it's how to get them to display on the GB that I'm not sure how to do. Fine tuning the positions is a smaller detail I can work on later -- the bigger challenge right now is getting the numbers to show up using JSL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SDF1_1-1692297598815.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55839i64EA810804BB9A46/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SDF1_1-1692297598815.png" alt="SDF1_1-1692297598815.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'd like to do this all in JSL so it's automated. Again, I'm using the Air.jmp data table as a test bed for this. Happy to add my code if you're interested -- just let me know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Hope this makes sense. Thanks for any help/suggestions you might have!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 18:43:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-place-label-next-to-data-point-in-GB-using-JSL/m-p/668993#M85710</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2023-08-17T18:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to place label next to data point in GB using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-place-label-next-to-data-point-in-GB-using-JSL/m-p/669010#M85712</link>
      <description>&lt;P&gt;What I would try first is to set Marker to the rows you wish to label and then use Label column property. This might not work correctly if you wish to show different points in different plots&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1692299482254.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55840iFEB67902FAD7381C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1692299482254.png" alt="jthi_0-1692299482254.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;For few other ideas, see "gpin" (you can do same things you could with &lt;A href="https://www.jmp.com/support/help/en/17.1/index.shtml#page/jmp/customize-hover-labels-in-jmp-graphs.shtml#" target="_blank" rel="noopener"&gt;hover labels&lt;/A&gt;) from scripting index or Graphics/Text&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 19:19:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-place-label-next-to-data-point-in-GB-using-JSL/m-p/669010#M85712</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-08-17T19:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to place label next to data point in GB using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-place-label-next-to-data-point-in-GB-using-JSL/m-p/669017#M85713</link>
      <description>&lt;P&gt;I would look into using &amp;lt;&amp;lt; Add Graphics Script.&amp;nbsp; You can step through the data table, and when you find a row with the value of 1 for PeriodogramPeaks(&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;script) you can use the X (Period) and Y (Spectral Density) values to place a Text() value at that point.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 19:38:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-place-label-next-to-data-point-in-GB-using-JSL/m-p/669017#M85713</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-08-17T19:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to place label next to data point in GB using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-place-label-next-to-data-point-in-GB-using-JSL/m-p/669179#M85734</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Once again, thanks for the wonderful suggestions. This time, I ended up going with&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;'s suggestion of using the &amp;lt;&amp;lt;Add Graphics Script because it gave me a little more flexibility in how I wanted to place the text as well as putting it inside a For() loop to loop through all the peak ranks. I had vectors of the all the Period, Frequency, and Spectral Density (or Periodogram) values, so looping through was easier than searching through the table. It works great, thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; One thing to note for any others reading this thread and trying something similar, when adding multiple graphics scripts to the GB or whatever graphic, it's important that you Substitute() the actual variables so that each new text will be placed in a unique location and not just overwritten by the last Add Graphics Script. What I mean by this, is that you need to do something like the following in order to add multiple different texts to the graphic:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
	Substitute(
			Expr(
				gbframebox_1 &amp;lt;&amp;lt; Add Graphics Script( Text( Eval( {__xpos__, __ypos__} ), __gb_text__ ) );
				gbframebox_2 &amp;lt;&amp;lt; Add Graphics Script( Text( Eval( {__fpos__, __ypos__} ), __gb_text__ ) );
			),
		Expr( __xpos__ ), xpos,
		Expr( __fpos__ ), fpos,
		Expr( __ypos__ ), ypos,
		Expr( __gb_text__ ), gb_text
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; All of that needs to be within a For() loop, of course, and with each iteration you redefine what the Expr() variables are so that each added text is unique. Here, the Expr() variables start and end with two underscore characters __ (I believe I adopted this from a previous suggestion I got from&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;on handling specification parameters using JSL). Note, for me there are two frame boxes because I am plotting the same y-variable against two different x-variables using graph builder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for all your help!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 14:38:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-place-label-next-to-data-point-in-GB-using-JSL/m-p/669179#M85734</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2023-08-18T14:38:43Z</dc:date>
    </item>
  </channel>
</rss>

