<?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 Script for setting all axis limits in a graph builder to values computed from the displayed data in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/573183#M78214</link>
    <description>&lt;P&gt;In order to speed up one step of a workflow, I am trying to write a script that automatically sets the axis limits of all Y axes in a graph builder to certain values (quantiles) that can be computed from the displayed data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The plan was:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Get the axis labels&lt;/LI&gt;&lt;LI&gt;Compute the desired limits by using the corresponding columns in the data table&lt;/LI&gt;&lt;LI&gt;Set the limits accordingly.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This turns out to be more complicated than expected in the first place, because a local data filter can be used, labels can be modified, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I would rather like to get the different Y values for each axis directly from the graph builder. &lt;STRONG&gt;How to get the values from specific axes?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;E.g. If I have&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;R = Current Report();
AB = R[axisbox(2)] ;
ab_min = -100; // How to access the value list containing all the values that are used by default to compute axis limits of AB here?
ab_max = 100;
AB &amp;lt;&amp;lt; Min(ab_min);
AB &amp;lt;&amp;lt; Max(ab_max);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;By using "the cross" I ended up with some FrameBoxes, but I could not figure out how to get values from them.&lt;/P&gt;&lt;P&gt;Any ideas or better way how to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Robbb&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Jun 2023 11:29:39 GMT</pubDate>
    <dc:creator>Robbb</dc:creator>
    <dc:date>2023-06-11T11:29:39Z</dc:date>
    <item>
      <title>Script for setting all axis limits in a graph builder to values computed from the displayed data</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/573183#M78214</link>
      <description>&lt;P&gt;In order to speed up one step of a workflow, I am trying to write a script that automatically sets the axis limits of all Y axes in a graph builder to certain values (quantiles) that can be computed from the displayed data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The plan was:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Get the axis labels&lt;/LI&gt;&lt;LI&gt;Compute the desired limits by using the corresponding columns in the data table&lt;/LI&gt;&lt;LI&gt;Set the limits accordingly.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This turns out to be more complicated than expected in the first place, because a local data filter can be used, labels can be modified, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I would rather like to get the different Y values for each axis directly from the graph builder. &lt;STRONG&gt;How to get the values from specific axes?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;E.g. If I have&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;R = Current Report();
AB = R[axisbox(2)] ;
ab_min = -100; // How to access the value list containing all the values that are used by default to compute axis limits of AB here?
ab_max = 100;
AB &amp;lt;&amp;lt; Min(ab_min);
AB &amp;lt;&amp;lt; Max(ab_max);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;By using "the cross" I ended up with some FrameBoxes, but I could not figure out how to get values from them.&lt;/P&gt;&lt;P&gt;Any ideas or better way how to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Robbb&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:29:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/573183#M78214</guid>
      <dc:creator>Robbb</dc:creator>
      <dc:date>2023-06-11T11:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Script for setting all axis limits in a graph builder to values computed from the displayed data</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/573262#M78222</link>
      <description>&lt;P&gt;Would something like this work? Use XPath to get all axisboxes and then figure out which are Y-axis. After that you should be able to manipulate them&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 = dt &amp;lt;&amp;lt; Graph Builder(
	Size(570, 1049),
	Show Control Panel(0),
	Variables(
		X(:age),
		Y(:height),
		Page(:sex)
	)
);

axisboxes = Report(gb) &amp;lt;&amp;lt; XPath("//AxisBox");
/*y-axis seems to be even numbers*/
yaxis = axisboxes[2::N Items(axisboxes)::2];
ymin = yaxis &amp;lt;&amp;lt; get min;
ymax = yaxis &amp;lt;&amp;lt; get max;
show(ymin, ymax);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Nov 2022 17:14:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/573262#M78222</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-11-24T17:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Script for setting all axis limits in a graph builder to values computed from the displayed data</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/573266#M78223</link>
      <description>&lt;P&gt;The following JSL will return a list of all of the AxisBox()s for the current report.&amp;nbsp; Both AxisBox(1) and AxisBox(2).&amp;nbsp; So what can be done is to process entries, 2, 4, 6 etc. to access all of the AxisBox(2)s&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;r=current report();
yMaxs = ((r[1]&amp;lt;&amp;lt;top parent) &amp;lt;&amp;lt; xpath("//AxisBox"))&amp;lt;&amp;lt;get max;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Nov 2022 17:23:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/573266#M78223</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-11-24T17:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script for setting all axis limits in a graph builder to values computed from the displayed data</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/575608#M78377</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;, hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks, but I think we have a little misunderstanding.&lt;BR /&gt;I do not want to get the current min and max from all y axes. I would like to get all corresponding y values of the displayed data in order to compute more appropriate limits.&lt;/P&gt;&lt;P&gt;For example, if for a y axis 1000 values are displayed, I would like to get a list or vector of those 1000 y values.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 08:18:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/575608#M78377</guid>
      <dc:creator>Robbb</dc:creator>
      <dc:date>2022-12-01T08:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script for setting all axis limits in a graph builder to values computed from the displayed data</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/575620#M78378</link>
      <description>&lt;P&gt;Why would it not work for you to just get the values from the data table?&amp;nbsp; If rows have been excluded from the analysis, or if a Local Data Filter has been applied, then one would have to just apply those conditions.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size(570, 1049),
	Show Control Panel(0),
	Variables(
		X(:age),
		Y(:height),
		Page(:sex)
	)
);

allHeights = dt:height &amp;lt;&amp;lt; get values;

// or if you want just the unique values of the column height, this 
// is my prefered way to get them

uniqueHeights = associative array(dt:height&amp;lt;&amp;lt;get values)&amp;lt;&amp;lt;get keys;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 10:57:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/575620#M78378</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-12-01T10:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Script for setting all axis limits in a graph builder to values computed from the displayed data</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/576415#M78433</link>
      <description>&lt;P&gt;Currently I do not see a reliable way to get the column or column name that is plotted on an axis from the graph builder. The only way I can think of is getting the axis label, but this may have been modified by the user so that the text is not the column name any more. Furthermore, columns can be transformed/modified directly in the graph builder. If such a column is plotted on an axis, I would not be able to find that column in the data table at all. And yes, If I found the correct column in the data table, I would have to apply the filter settings from the local data filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I could get the plotted data values directly back from the axis/graph builder somehow, it would be unimportant which kind of column is plotted, which filter is applied, which labels the user changed and what else could possibly go wrong and break my script.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 07:29:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/576415#M78433</guid>
      <dc:creator>Robbb</dc:creator>
      <dc:date>2022-12-02T07:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script for setting all axis limits in a graph builder to values computed from the displayed data</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/576421#M78434</link>
      <description>&lt;P&gt;Something like this should get you the marker values&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 = dt &amp;lt;&amp;lt; Graph Builder(
	Size(570, 1049),
	Show Control Panel(0),
	Variables(
		X(:age),
		Y(:height),
		Page(:sex)
	)
);

frame = Report(gb)[FrameBox(1)];
frames = Report(gb) &amp;lt;&amp;lt; XPath("//FrameBox");
marker_segs = (frames &amp;lt;&amp;lt; Find Seg(Marker Seg(1)));
xm = marker_segs &amp;lt;&amp;lt; Get X Values;
ym = marker_segs &amp;lt;&amp;lt; Get Y Values;
show(xm, ym);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;LI-MESSAGE title="exporting x&amp;amp;amp;y values (coordinates) from graph builder once jmp automatically finds centroid points for a polygon" uid="193440" url="https://community.jmp.com/t5/Discussions/exporting-x-amp-y-values-coordinates-from-graph-builder-once-jmp/m-p/193440#U193440" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="How to get Legend Box information, like color and marker type" uid="252961" url="https://community.jmp.com/t5/Discussions/How-to-get-Legend-Box-information-like-color-and-marker-type/m-p/252961#U252961" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 07:52:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-setting-all-axis-limits-in-a-graph-builder-to-values/m-p/576421#M78434</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-12-02T07:52:33Z</dc:date>
    </item>
  </channel>
</rss>

