<?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: Get number of frame boxes in a graphbuilder plot? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Get-number-of-frame-boxes-in-a-graphbuilder-plot/m-p/315091#M56719</link>
    <description>&lt;P&gt;To directly answer your question, you can count the items returned with an XPath query.&amp;nbsp; A better solution, though, is to just send the Marker Size message to all of the results returned with XPath rather than using Dispatch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$sample_data\Big Class.jmp" );

gb = Graph Builder(
	Show Control Panel( 0 ), 
	Variables( X( :weight ), Y( :height ), Group Y( :sex ) ), 
	Elements( Points( X, Y, Legend( 1 ) ) ), 
);

//Count Frame boxes here
N Items( (gb &amp;lt;&amp;lt; XPath( "//FrameBox" )) );

//Or just update them all
(gb &amp;lt;&amp;lt; XPath( "//FrameBox" )) &amp;lt;&amp;lt; Marker Size( 8 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 18:15:28 GMT</pubDate>
    <dc:creator>ih</dc:creator>
    <dc:date>2020-09-30T18:15:28Z</dc:date>
    <item>
      <title>Get number of frame boxes in a graphbuilder plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Get-number-of-frame-boxes-in-a-graphbuilder-plot/m-p/315046#M56716</link>
      <description>&lt;P&gt;Hi. &amp;nbsp;I'd like to know if there is a good way to get the number of frame boxes in a graphbuilder plot. &amp;nbsp;I have a GB plot that contains 104 FB (8 X-groups, 13 Y-groups). &amp;nbsp;I've written a script to change the marker size for each FB. &amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	Summarize(dtstack, frame_lis = By(:Freq, :Image, :Region));
	For(i=1, i&amp;lt;=NItems(frame_lis[1]), i++,
		Try(
			Report(gb) &amp;lt;&amp;lt; Dispatch({}, "Graph Builder", FrameBox(i), 
				{Marker Size(1)}
			)
		)
	);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(credit to &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/182"&gt;@ms&lt;/a&gt;&amp;nbsp;in&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/Can-t-change-all-marker-size-in-Graph-Builder-by-script/m-p/3928" target="_self"&gt;https://community.jmp.com/t5/Discussions/Can-t-change-all-marker-size-in-Graph-Builder-by-script/m-p/3928&lt;/A&gt;&amp;nbsp;). &amp;nbsp;But in my case, the Summarize statement overestimates the number of FB, as I've excluded several rows in my table containing certain values of Region, Image, or Freq. &amp;nbsp;This script works, but once the counter i exceeds the the actual number of FB in the GB plot, I begin getting error messages in the log ("Cannot find FrameBox[ "Graph Builder" ] at {}"). &amp;nbsp;The "Try" statement was an attempt to prevent the error messages, but did not work. &amp;nbsp;At any rate, I'd prefer to avoid this by just computing the correct number of frame boxes to begin with. &amp;nbsp;Anyone have any ideas?&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:06:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-number-of-frame-boxes-in-a-graphbuilder-plot/m-p/315046#M56716</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2023-06-11T11:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Get number of frame boxes in a graphbuilder plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Get-number-of-frame-boxes-in-a-graphbuilder-plot/m-p/315091#M56719</link>
      <description>&lt;P&gt;To directly answer your question, you can count the items returned with an XPath query.&amp;nbsp; A better solution, though, is to just send the Marker Size message to all of the results returned with XPath rather than using Dispatch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$sample_data\Big Class.jmp" );

gb = Graph Builder(
	Show Control Panel( 0 ), 
	Variables( X( :weight ), Y( :height ), Group Y( :sex ) ), 
	Elements( Points( X, Y, Legend( 1 ) ) ), 
);

//Count Frame boxes here
N Items( (gb &amp;lt;&amp;lt; XPath( "//FrameBox" )) );

//Or just update them all
(gb &amp;lt;&amp;lt; XPath( "//FrameBox" )) &amp;lt;&amp;lt; Marker Size( 8 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 18:15:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-number-of-frame-boxes-in-a-graphbuilder-plot/m-p/315091#M56719</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2020-09-30T18:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Get number of frame boxes in a graphbuilder plot?</title>
      <link>https://community.jmp.com/t5/Discussions/Get-number-of-frame-boxes-in-a-graphbuilder-plot/m-p/319891#M57025</link>
      <description>Thanks &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6657"&gt;@ih&lt;/a&gt; . That seems to have worked well. For some reason I get an error when I try to accept your answer as the solution - but this was the solution.</description>
      <pubDate>Fri, 09 Oct 2020 23:21:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-number-of-frame-boxes-in-a-graphbuilder-plot/m-p/319891#M57025</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2020-10-09T23:21:21Z</dc:date>
    </item>
  </channel>
</rss>

