<?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: Help Pulling Data for Dynamic Axis Limit Setting in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-Pulling-Data-for-Dynamic-Axis-Limit-Setting/m-p/394747#M64525</link>
    <description>&lt;P&gt;If you have your spec limits saved as column properties, and have indicated to "Show Limits", Graph Builder will automatically expand the axes range to include the USL and LSL.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="s1.JPG" style="width: 548px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33685i7F1B97BAAC6C6078/image-dimensions/548x384?v=v2" width="548" height="384" role="button" title="s1.JPG" alt="s1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;However, you can easily override the axis values, as shown below, where the maximum X axis value is changed to the USL plus 10% of the range of USL-LSL&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="s2.JPG" style="width: 557px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33686i4D6DB63A5CE27ECE/image-dimensions/557x388?v=v2" width="557" height="388" role="button" title="s2.JPG" alt="s2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here is the simple script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
dt = Open( "\Example.jmp" );

// Change column property: NPN1
Data Table( "Example" ):NPN1 &amp;lt;&amp;lt; Set Property(
	"Spec Limits",
	{LSL( 104.41 ), USL( 131.89 ), Target( 118.15 ), Show Limits( 1 )}
);


// Change column property: NPN2
Data Table( "Example" ):NPN2 &amp;lt;&amp;lt; Set Property(
	"Spec Limits",
	{LSL( 96.59 ), USL( 130.9 ), Target( 113.75 ), Show Limits( 1 )}
);


// Report snapshot: semiconductor capability - Graph Builder
gb = Data Table( "Example" ) &amp;lt;&amp;lt;
Graph Builder(
	Variables( X( :NPN2 ), Y( :NPN1 ) ),
	Elements( Points( X, Y, Legend( 3 ) ) )
);

// Set Maximum  Y axis value to be displayed
specs = dt:NPN1 &amp;lt;&amp;lt; get property( "Spec Limits" );
maxY = Max( Col Maximum( :NPN1 ), specs["USL"] + .1 * (specs["USL"] - specs["LSL"]) );
Report( gb )[AxisBox( 2 )] &amp;lt;&amp;lt; Max( maxY );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 21 Jun 2021 15:21:16 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2021-06-21T15:21:16Z</dc:date>
    <item>
      <title>Help Pulling Data for Dynamic Axis Limit Setting</title>
      <link>https://community.jmp.com/t5/Discussions/Help-Pulling-Data-for-Dynamic-Axis-Limit-Setting/m-p/394719#M64523</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to determine the axis limits on a graph depending on the current data plotted so that all reference lines and data points are visible after user inputs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The axis limit set will either be the value of the USL / LSL reference line or the highest / lowest data point plotted. The graph in use in a Variability Chart and the data are the values in Column 2 grouped by Column 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Initially I thought I could do this by determining the min/max of the two values where the reference to the data was determined by the Col Minimum function with the &amp;lt;ByVariable argument. But it appears this function can not be used this way.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Var1_Min = Eval( Min((LSL[1]*0.95), Col Minimum( :Column 2, :Column 1["Group1"] )));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've spent a lot of time searching and can't seem to find a function that does what I need to - any ides?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:15:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-Pulling-Data-for-Dynamic-Axis-Limit-Setting/m-p/394719#M64523</guid>
      <dc:creator>amurphy</dc:creator>
      <dc:date>2023-06-11T11:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help Pulling Data for Dynamic Axis Limit Setting</title>
      <link>https://community.jmp.com/t5/Discussions/Help-Pulling-Data-for-Dynamic-Axis-Limit-Setting/m-p/394747#M64525</link>
      <description>&lt;P&gt;If you have your spec limits saved as column properties, and have indicated to "Show Limits", Graph Builder will automatically expand the axes range to include the USL and LSL.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="s1.JPG" style="width: 548px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33685i7F1B97BAAC6C6078/image-dimensions/548x384?v=v2" width="548" height="384" role="button" title="s1.JPG" alt="s1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;However, you can easily override the axis values, as shown below, where the maximum X axis value is changed to the USL plus 10% of the range of USL-LSL&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="s2.JPG" style="width: 557px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33686i4D6DB63A5CE27ECE/image-dimensions/557x388?v=v2" width="557" height="388" role="button" title="s2.JPG" alt="s2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here is the simple script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
dt = Open( "\Example.jmp" );

// Change column property: NPN1
Data Table( "Example" ):NPN1 &amp;lt;&amp;lt; Set Property(
	"Spec Limits",
	{LSL( 104.41 ), USL( 131.89 ), Target( 118.15 ), Show Limits( 1 )}
);


// Change column property: NPN2
Data Table( "Example" ):NPN2 &amp;lt;&amp;lt; Set Property(
	"Spec Limits",
	{LSL( 96.59 ), USL( 130.9 ), Target( 113.75 ), Show Limits( 1 )}
);


// Report snapshot: semiconductor capability - Graph Builder
gb = Data Table( "Example" ) &amp;lt;&amp;lt;
Graph Builder(
	Variables( X( :NPN2 ), Y( :NPN1 ) ),
	Elements( Points( X, Y, Legend( 3 ) ) )
);

// Set Maximum  Y axis value to be displayed
specs = dt:NPN1 &amp;lt;&amp;lt; get property( "Spec Limits" );
maxY = Max( Col Maximum( :NPN1 ), specs["USL"] + .1 * (specs["USL"] - specs["LSL"]) );
Report( gb )[AxisBox( 2 )] &amp;lt;&amp;lt; Max( maxY );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Jun 2021 15:21:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-Pulling-Data-for-Dynamic-Axis-Limit-Setting/m-p/394747#M64525</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-06-21T15:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help Pulling Data for Dynamic Axis Limit Setting</title>
      <link>https://community.jmp.com/t5/Discussions/Help-Pulling-Data-for-Dynamic-Axis-Limit-Setting/m-p/394753#M64528</link>
      <description>&lt;P&gt;Thank you for your response Jim!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I don't have a single spec limit for my column as there's a distinction between the values based on another column so I haven't found a way to do traditional column spec limits yet without completely splitting my data into two tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was ultimately able to find the solution to my problem by using Get Rows Where:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
G1 = dt &amp;lt;&amp;lt; Get Rows Where (:Column 1 == "Group1");
G1_Min = Eval( Min((LSL[1]*0.95), Min(:Column 2[G1])));
G1_Max = Eval( Max((USL[1]*1.05), Max(:Column 2[G1])));&lt;BR /&gt;dt &amp;lt;&amp;lt; clear select;
&lt;BR /&gt;dt = Current Data Table();
G2 = dt &amp;lt;&amp;lt; Get Rows Where (:Column 1 == "Group2");
G2_Min = Eval( Min((LSL[2]*0.95), Min(:Column 2[G2])));
G2_Max = Eval( Max((USL[2]*1.05), Max(:Column 2[G2])));&lt;BR /&gt;dt &amp;lt;&amp;lt; clear select;&lt;/CODE&gt;&lt;CODE class=" language-jsl"&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then to graph within dispatch section (for the first graph, second is duplicate with 1-&amp;gt;2):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Dispatch ({Min(G1_Min), Max(G1_Max), Inc( Eval((G1_Max - G1_Min) / 7))),
Add Ref Line( LSL[1], "Solid", "Medium Dark Blue", "LSL", 1 ),
Add Ref Line( USL[1], "Solid", "Medium Dark Blue", "USL", 1 )}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;* Note I forgot to mention in my original question that the USL/LSL are already defined in a lists and used for the reference lines.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 16:01:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-Pulling-Data-for-Dynamic-Axis-Limit-Setting/m-p/394753#M64528</guid>
      <dc:creator>amurphy</dc:creator>
      <dc:date>2021-06-21T16:01:53Z</dc:date>
    </item>
  </channel>
</rss>

