<?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: Send commands to multiple Bivariate Plots in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46114#M26286</link>
    <description>&lt;P&gt;Or much simpler&amp;nbsp;with &lt;EM&gt;xpath&lt;/EM&gt;, inspired by a&amp;nbsp;JMP Summit presentation that just was posted &lt;A href="https://community.jmp.com/t5/Discovery-Summit-2017/Using-JSL-to-Develop-Efficient-Robust-Applications/ta-p/46097/jump-to/first-unread-message" target="_blank"&gt;here&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
//Example report
Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("example",
    lub = Lineup Box(
        Bivariate(Y(:weight), X(:height), FitLine()),
        Bivariate(Y(:weight), X(:age), FitLine()),
        Bivariate(Y(:age), X(:age), FitLine()),
        Bivariate(Y(:weight), X(:weight), FitLine())
    )
);

//Make list of plots
L = (lub &amp;lt;&amp;lt; xpath("//LineUpBox/OutlineBox")) &amp;lt;&amp;lt; get scriptable object;

// Send messages to all plots, e.g
L &amp;lt;&amp;lt; show points(0);
&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Oct 2017 22:33:54 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2017-10-18T22:33:54Z</dc:date>
    <item>
      <title>Send commands to multiple Bivariate Plots</title>
      <link>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46085#M26277</link>
      <description>&lt;P&gt;I have a script that generates a series of bivariate plots within a single window, using a LineUpBox to contain each plot.&amp;nbsp; After the plots have been created, I want the option for the user to toggle on/off the points of the plot (I intend to add other options...this is serving only as&amp;nbsp;one example).&amp;nbsp; I envision a buttonbox or checkbox in the window the user&amp;nbsp;can click on, and&amp;nbsp;all the plots will reflect this action.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a single plot, I would use the command:&lt;/P&gt;&lt;PRE&gt;bvp &amp;lt;&amp;lt; Show Points(0/1);&lt;/PRE&gt;&lt;P&gt;where bvp is the reference to the bivariate plot.&amp;nbsp; However, here I have multiple plots and cannot use a single reference for them all.&amp;nbsp; I tried&amp;nbsp;referencing to my&amp;nbsp;LineUpBox that contains the plots instead:&lt;FONT color="#0000dd" face="Consolas" size="2"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;For(plid = 1, plid &amp;lt;= nplots, plid++,
 LUB_plots[plid] &amp;lt;&amp;lt; Show Points(pts)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where LUB_plots is the reference to my lineupbox.&amp;nbsp; &amp;nbsp;This loop would be run each time the user checks the checkbox, for example.&amp;nbsp; When I do this, I get the following errors:&lt;/P&gt;&lt;PRE&gt;The display box 'OutlineBox' does not recognize the message 'Show Points'; perhaps you mean one of these:  &amp;lt;&amp;lt;Show Properties &amp;lt;&amp;lt;Show HelpKeys &amp;lt;&amp;lt;SetHorizontal &amp;lt;&amp;lt;Horizontal &amp;lt;&amp;lt;SetOpen &amp;lt;&amp;lt;GetHorizontal &amp;lt;&amp;lt;Close Where No Outlines &amp;lt;&amp;lt;Font &amp;lt;&amp;lt;Set Font &amp;lt;&amp;lt;Set Font Style &amp;lt;&amp;lt;Set Font Size &amp;lt;&amp;lt;Reshow &amp;lt;&amp;lt;Set Report Title &amp;lt;&amp;lt;Set Window Title &amp;lt;&amp;lt;Top Parent &amp;lt;&amp;lt;Show Tree Structure &amp;lt;&amp;lt;Restore Window Size &amp;lt;&amp;lt;Set Window Size &amp;lt;&amp;lt;Set Content Size &amp;lt;&amp;lt;Get Window Position &amp;lt;&amp;lt;Show Window &amp;lt;&amp;lt;Get Show Window &amp;lt;&amp;lt;Set Window Title &amp;lt;&amp;lt;Set Window Icon &amp;lt;&amp;lt;Set Print Headers &amp;lt;&amp;lt;Set Print Footers &amp;lt;&amp;lt;Scroll Window &amp;lt;&amp;lt;Set Width &amp;lt;&amp;lt;Set Height &amp;lt;&amp;lt;Horizontal Alignment.&lt;/PRE&gt;&lt;P&gt;and&amp;nbsp;an instance of&amp;nbsp;the following for each plot:&lt;/P&gt;&lt;PRE&gt;(The following message might not be an actual error; the preference 'Report Invalid Display Box Messages' is ON.) The display box 'OutlineBox' does not recognize the message 'Show Points'.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked the tree structure and confirm that yes, the top display box is indeed an outline box.&amp;nbsp; So at least I know LineUpBox[plid] is aiming where I expected it to.&amp;nbsp; The problem seems to be that&amp;nbsp;my &amp;lt;&amp;lt;Show Points command sees the outline box it's pointed to, but fails to recognize that the outline box is actually part of a bivariate plot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question: How can I reference multiple bivariate plots?&amp;nbsp; Alternatively, is there a better way to send commands to multiple bivariate plots after they've been created?&amp;nbsp; Perhaps using some sort of Dispatch/SendtoReports command structure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure how to even search the community for this one.&amp;nbsp; Any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 16:57:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46085#M26277</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2017-10-18T16:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Send commands to multiple Bivariate Plots</title>
      <link>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46109#M26282</link>
      <description>&lt;P&gt;The &lt;EM&gt;show points()&amp;nbsp;&lt;/EM&gt;message needs to be sent to the &lt;EM&gt;Bivariate&lt;/EM&gt; object rather than to its top display box. From an existing display tree, a reference to the associated&amp;nbsp;object&amp;nbsp;can be obtained by &lt;EM&gt;&amp;lt;&amp;lt;Get Scriptable Object&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example that also illustrates one way to send messages to multiple plots:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
//Example report
Open("$SAMPLE_DATA/Big Class.jmp");
New Window("example",
    lub = Lineup Box(
        Bivariate(Y(:weight), X(:height), FitLine()),
        Bivariate(Y(:weight), X(:age), FitLine()),
        Bivariate(Y(:age), X(:age), FitLine()),
        Bivariate(Y(:weight), X(:weight), FitLine())
    )
);

//Make list of plots (here top-level Outline boxes)
L = {};
i = 1;
While(Is Scriptable(Try(lub[Outline Box(i)])),
    If((lub[Outline Box(i)] &amp;lt;&amp;lt; parent) &amp;lt;&amp;lt; classname == "LineUpBox",
        Insert Into(L, lub[Outline Box(i)] &amp;lt;&amp;lt; get scriptable object)
    );
    i++;
);

// Send messages to all plots, e.g
L &amp;lt;&amp;lt; show points(0);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Oct 2017 21:23:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46109#M26282</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2017-10-18T21:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Send commands to multiple Bivariate Plots</title>
      <link>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46114#M26286</link>
      <description>&lt;P&gt;Or much simpler&amp;nbsp;with &lt;EM&gt;xpath&lt;/EM&gt;, inspired by a&amp;nbsp;JMP Summit presentation that just was posted &lt;A href="https://community.jmp.com/t5/Discovery-Summit-2017/Using-JSL-to-Develop-Efficient-Robust-Applications/ta-p/46097/jump-to/first-unread-message" target="_blank"&gt;here&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
//Example report
Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("example",
    lub = Lineup Box(
        Bivariate(Y(:weight), X(:height), FitLine()),
        Bivariate(Y(:weight), X(:age), FitLine()),
        Bivariate(Y(:age), X(:age), FitLine()),
        Bivariate(Y(:weight), X(:weight), FitLine())
    )
);

//Make list of plots
L = (lub &amp;lt;&amp;lt; xpath("//LineUpBox/OutlineBox")) &amp;lt;&amp;lt; get scriptable object;

// Send messages to all plots, e.g
L &amp;lt;&amp;lt; show points(0);
&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 22:33:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46114#M26286</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2017-10-18T22:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Send commands to multiple Bivariate Plots</title>
      <link>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46216#M26334</link>
      <description>&lt;P&gt;Thanks!&amp;nbsp; The xpath cmd&amp;nbsp;works great for&amp;nbsp;my show points example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I have a followup.&amp;nbsp; How can&amp;nbsp;I send a command to all my plots that changes the y-axis from linear to log?&amp;nbsp; As a start, I tried using the xpath command with the intent of creating a list of all references to all the y-axis boxes.&amp;nbsp;I'm first just trying to confirm that the xpath command is pulling the correct refs.&amp;nbsp; But I can't seem to get it to return just those boxes though.&amp;nbsp; By inspecting the xml code in the log, I could see the y-axis boxes all have a "charID=\!"2\!"", so I'm trying to use that to differentiate the y's from the x's, but no luck.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Names Default To Here(1);

//Example report
Open("$SAMPLE_DATA/Big Class.jmp");
Try(Window("example") &amp;lt;&amp;lt; Close Window);
nw = New Window("example",
    lub = Lineup Box(
        Bivariate(Y(:weight), X(:height), FitLine()),
        Bivariate(Y(:weight), X(:age), FitLine()),
        Bivariate(Y(:age), X(:age), FitLine()),
        Bivariate(Y(:weight), X(:weight), FitLine())
    )
);&lt;BR /&gt;&lt;BR /&gt;Show(lub &amp;lt;&amp;lt; Get xml);

Show(lub &amp;lt;&amp;lt; xpath("//AxisBox"));				//list of 8 displayboxes
Show(lub &amp;lt;&amp;lt; xpath("//AxisBox[2]"));			//empty list
Show(lub &amp;lt;&amp;lt; xpath("//AxisBox['2']"));			//list of 8 displayboxes
Show(lub &amp;lt;&amp;lt; xpath("//AxisBox[\!"2\!"]"));			//list of 8 displayboxes
Show(lub &amp;lt;&amp;lt; xpath("//AxisBox[charID=\!"2\!"]"));	//empty list
Show(lub &amp;lt;&amp;lt; xpath("//AxisBox[\!"charID=2\!"]"));	//list of 8 displayboxes&lt;/PRE&gt;&lt;P&gt;How can I get xpath to return just the 4 y axisboxes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once I succeed in generating the references to the specific axis boxes I want, do I need to send the "Get Scriptable Object" command as with your previous example, or can I just send the "Scale" command directly to the list of references?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read through the JMP Summit presentation and the .jsl code examples you provided...very helpful.&amp;nbsp; However,&amp;nbsp;additional documentation is sparse in the Scripting Index, and appears to be non-existent in Scripting Guide.&amp;nbsp; Is there more documentation available on xpath?&amp;nbsp; I'd like to know what the format is for the input.&amp;nbsp; For example,&amp;nbsp;what does&amp;nbsp;the "//" do at the beginning?&amp;nbsp;&amp;nbsp;And how&amp;nbsp;should I&amp;nbsp;format the rest of the input to get the displayboxes I need?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 15:17:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46216#M26334</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2017-10-20T15:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Send commands to multiple Bivariate Plots</title>
      <link>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46219#M26336</link>
      <description>&lt;P&gt;This syntax seems to work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;y_axes = (lub &amp;lt;&amp;lt; xpath("//AxisBox[@charID='2']"));
y_axes &amp;lt;&amp;lt; scale(Log);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For xpath documentation, see for example&amp;nbsp;&lt;A href="https://www.w3schools.com/xml/xpath_intro.asp" target="_blank"&gt;w3schools tutorial on XPath&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 16:07:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46219#M26336</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2017-10-20T16:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Send commands to multiple Bivariate Plots</title>
      <link>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46222#M26337</link>
      <description>&lt;P&gt;Thanks again.&amp;nbsp; Elegant.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 18:53:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Send-commands-to-multiple-Bivariate-Plots/m-p/46222#M26337</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2017-10-20T18:53:20Z</dc:date>
    </item>
  </channel>
</rss>

