<?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: Updating the Graph Builder's Element statement in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Updating-the-Graph-Builder-s-Element-statement/m-p/66157#M34375</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2518"&gt;@DMR&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Update Element() will change the properties of an existing element, but as far as I know will not allow you to change the type of element it is. Try deleting the existing element and adding a new one. Example below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open("$SAMPLE_DATA/Big Class.jmp");

gb = Graph Builder(
	Size( 528, 448 ),
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :height ) ),
	Elements( Box Plot( X, Y, Legend( 4 ) ) )
);

Wait(1);

gbb = Report( gb )[Graph Builder Box( 1 )];

gbb &amp;lt;&amp;lt; Remove Element(1, 1, 1);
gbb &amp;lt;&amp;lt; Add Element(1, 1, {Type( "Points" ), X, Y, Legend( 5 )});
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Aug 2018 18:53:24 GMT</pubDate>
    <dc:creator>jules</dc:creator>
    <dc:date>2018-08-02T18:53:24Z</dc:date>
    <item>
      <title>Updating the Graph Builder's Element statement</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-the-Graph-Builder-s-Element-statement/m-p/66064#M34362</link>
      <description>&lt;P&gt;Hi - I want to change the style of&amp;nbsp;the Graph Builder's&amp;nbsp;box-and-whisker plot to a plot of points from within a JSL script. The Graph Builder initially includes an Elements statement that looks like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;				Elements( Box Plot( Y, Legend( 9 ) ) ),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I therefore want to modify that statement from within JSL to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;				Elements( Points( Y, Legend( 9 ) ) ),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found the &amp;lt;&amp;lt; Add Element, &amp;lt;&amp;lt; Update Element and &amp;lt;&amp;lt; Remove Element commands for the GraphBuilderBox within the Scripting Index, but I can't work out how to apply them to achieve the effect I want. The example given in the Index (adding a regression line) doesn't directly relate to my situation, but I'm guessing that I need something &lt;EM&gt;like&lt;/EM&gt; the following, where gb is my Graph Builder object:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;report(gb)[GraphBuilderBox(1)] &amp;lt;&amp;lt; Update Element(1, 1, 1, {Type("Points"), Y})&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This evidently isn't&amp;nbsp;right however - so I just need an example to show me what the correct syntax ought to be. Can anyone help me with this, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 15:35:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-the-Graph-Builder-s-Element-statement/m-p/66064#M34362</guid>
      <dc:creator>DMR</dc:creator>
      <dc:date>2018-08-02T15:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Updating the Graph Builder's Element statement</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-the-Graph-Builder-s-Element-statement/m-p/66157#M34375</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2518"&gt;@DMR&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Update Element() will change the properties of an existing element, but as far as I know will not allow you to change the type of element it is. Try deleting the existing element and adding a new one. Example below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open("$SAMPLE_DATA/Big Class.jmp");

gb = Graph Builder(
	Size( 528, 448 ),
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :height ) ),
	Elements( Box Plot( X, Y, Legend( 4 ) ) )
);

Wait(1);

gbb = Report( gb )[Graph Builder Box( 1 )];

gbb &amp;lt;&amp;lt; Remove Element(1, 1, 1);
gbb &amp;lt;&amp;lt; Add Element(1, 1, {Type( "Points" ), X, Y, Legend( 5 )});
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 18:53:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-the-Graph-Builder-s-Element-statement/m-p/66157#M34375</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2018-08-02T18:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Updating the Graph Builder's Element statement</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-the-Graph-Builder-s-Element-statement/m-p/66324#M34396</link>
      <description>&lt;P&gt;Hi Julian,&lt;/P&gt;&lt;P&gt;I'm closer to understanding&amp;nbsp;the problem now, but unfortunately I'm still not quite there.&amp;nbsp; The difference between my situation and your example is that I'm using a discrete grouping variable instead of a continuous X variable: the following variation of your script illustrates the issue:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open("$SAMPLE_DATA/Big Class.jmp");

gb = Graph Builder(
	Variables( Y( :height ), Group X( :sex ) ),
	Elements( Box Plot( Y, Legend( 10 ) ) )
	);

wait( 1 );

gbb = Report( gb )[Graph Builder Box( 1 )];

// How do I modify the following two lines to replace the Box Plot above by Points?

gbb &amp;lt;&amp;lt; Remove Element(1, 1, 1);
gbb &amp;lt;&amp;lt; Add Element(1, 1, {Type( "Points" ), X, Y, Legend( 5 )});&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can just show me how to modify the final two lines, the problem&amp;nbsp;will be&amp;nbsp;solved.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 08:35:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-the-Graph-Builder-s-Element-statement/m-p/66324#M34396</guid>
      <dc:creator>DMR</dc:creator>
      <dc:date>2018-08-03T08:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Updating the Graph Builder's Element statement</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-the-Graph-Builder-s-Element-statement/m-p/66340#M34403</link>
      <description>&lt;P&gt;I see just what your issue is now. Since you're using an X Grouping, and not an actual X variable, the indexing for the elements isn't standard. As per the docs:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obj &amp;lt;&amp;lt; Get Element(xposition, yposition, i )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But, with an X Grouping, rather than an X, it seems that the first element isn't accessible&amp;nbsp;with (1,1,1),&amp;nbsp;&lt;SPAN&gt;(0,1,1),&amp;nbsp;(.,1,1)&lt;/SPAN&gt; or anything else I've tried.&amp;nbsp; So, here's what I came up with: temporarily define an X variable so you can access the element, and then remove the X variable once you've made the changes you need. I find it&amp;nbsp;entirely inelegant, but it works. I'll try to find out if there is a proper way to access the elements when no X is defined so you don't need this workaround.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open("$SAMPLE_DATA/Big Class.jmp");

gb = Graph Builder(
	Variables( Y( :height ), Group X( :sex ) ),
	Elements( Box Plot( Y, Legend( 10 ) ) )
	);

wait( 1 );

gbb = Report( gb )[Graph Builder Box( 1 )];

//define an X temporarily
gbb &amp;lt;&amp;lt; Add Variable( {:age, Role( "X" )} );

gbb &amp;lt;&amp;lt; Remove Element(1, 1, 1);
gbb &amp;lt;&amp;lt; Add Element(1, 1, {Type( "Points" ), X, Y, Legend( 5 )});

//remove the X
gbb &amp;lt;&amp;lt; Remove Variable( {:age, Role( "X" )} );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 13:15:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-the-Graph-Builder-s-Element-statement/m-p/66340#M34403</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2018-08-03T13:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Updating the Graph Builder's Element statement</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-the-Graph-Builder-s-Element-statement/m-p/66409#M34419</link>
      <description>&lt;P&gt;Inelegant it may be, but it works - and ultimately that's all that matters!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 17:22:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-the-Graph-Builder-s-Element-statement/m-p/66409#M34419</guid>
      <dc:creator>DMR</dc:creator>
      <dc:date>2018-08-03T17:22:54Z</dc:date>
    </item>
  </channel>
</rss>

