<?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: Auto Scaling in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Auto-Scaling/m-p/800040#M97577</link>
    <description>&lt;P&gt;Nice script as usual!&amp;nbsp; Some useful things for sure.&amp;nbsp; Because my original script is not operating on columns directly and I'm using an associative array (I'm new to those) I can't obviously see where to interrupt my code to make the modification?&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2024 18:36:04 GMT</pubDate>
    <dc:creator>SpannerHead</dc:creator>
    <dc:date>2024-09-18T18:36:04Z</dc:date>
    <item>
      <title>Auto Scaling</title>
      <link>https://community.jmp.com/t5/Discussions/Auto-Scaling/m-p/799986#M97575</link>
      <description>&lt;P&gt;Following up with this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Automatic-Scaling-Matching-X-and-Y-Axes/m-p/762890#M94321" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Automatic-Scaling-Matching-X-and-Y-Axes/m-p/762890#M94321&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I discovered a flaw in the script whereby excluded rows are not plotted but still factor in the graph scaling.&amp;nbsp; I need a way to eliminate those from y_there and x_there somehow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
dt &amp;lt;&amp;lt; Clear Column Selection();
colList = dt &amp;lt;&amp;lt; get column names( string );
check_list = {"VT", "ID", "DI", "IK", "GM"};
New Window( "Select Variables",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;On Validate( window:validated ),
	window:enable function = Function( {},
		{Default Local},
		X = window:lbMajor &amp;lt;&amp;lt; Get Selected;
		Y = window:lbMinor &amp;lt;&amp;lt; Get Selected;
		If( N Items( X ) &amp;amp; N Items( Y ) &amp;amp; X != Y,
			window:validated = 1,
			window:validated = 0
		);
		window:ok button &amp;lt;&amp;lt; Enable( window:validated );
	);
	H List Box(
		V List Box(
			Text Box( "Select X Variable" ),
			window:lbMajor = List Box(
				check_list,
				&amp;lt;&amp;lt;Set Max Selected( 1 ),
				enable function
			)
		),
		V List Box(
			Text Box( "Select Y Variable" ),
			window:lbMinor = List Box(
				check_list,
				&amp;lt;&amp;lt;Set Max Selected( 1 ),
				enable function
			)
		)
	);,
	H List Box(
		window:ok button = Button Box( "OK",
			X = window:lbMajor &amp;lt;&amp;lt; Get Selected;
			Y = window:lbMinor &amp;lt;&amp;lt; Get Selected;
			If( N Items( X ) &amp;amp; N Items( Y ) &amp;amp; X != Y,
				window:validated = 1,
				window:validated = 0
			);
			If( window:validated,
				Print( "Processing with X: " || Char( X ) || ", Y: " || Char( Y ) );
				Window( "Select Variables" ) &amp;lt;&amp;lt; Close Window;
			,
				Beep();
				Show( "Invalid Selection" );
				{window:lbMajor, window:lbMinor} &amp;lt;&amp;lt; Select;
				window:lbMajor &amp;lt;&amp;lt; Inval &amp;lt;&amp;lt; Update Window;
				Wait( 0.25 );
				{window:lbMajor, window:lbMinor} &amp;lt;&amp;lt; DeSelect;
				window:lbMajor &amp;lt;&amp;lt; Inval &amp;lt;&amp;lt; Update Window;
				Wait( 0.25 );
				{window:lbMajor, window:lbMinor} &amp;lt;&amp;lt; Select;
				window:lbMajor &amp;lt;&amp;lt; Inval &amp;lt;&amp;lt; Update Window;
				Wait( 0.25 );
				{window:lbMajor, window:lbMinor} &amp;lt;&amp;lt; DeSelect;
				window:lbMajor &amp;lt;&amp;lt; Inval &amp;lt;&amp;lt; Update Window;
			);,
			&amp;lt;&amp;lt;Enable( 0 )
		),
		Button Box( "Cancel", Throw( "!Canceled Analysis" ) )
	)
);
If(
	X[1] == "VT", Xparam = "VT",
	X[1] == "ID", Xparam = "ID",
	X[1] == "DI", Xparam = "DI",
	X[1] == "IK", Xparam = "IK",
	X[1] == "GM", Xparam = "GM"
);
If(
	Y[1] == "VT", Yparam = "VT",
	Y[1] == "ID", Yparam = "ID",
	Y[1] == "DI", Yparam = "DI",
	Y[1] == "IK", Yparam = "IK",
	Y[1] == "GM", Yparam = "GM"
);
Show( Xparam );
Show( Yparam );
For( i = 1, i &amp;lt;= N Cols( dt ), i++,
	If(
		Contains( Munger( Head Name( As Namespace( colList[i] ) ), 0, 2 ), Xparam )
		 &amp;amp; Contains(
			Head Name( As Namespace( colList[i] ) ),
			"% Delta From Target"
		),
		Column( colList[i] ) &amp;lt;&amp;lt; Set Selected( 1 )
	)
);
target = dt &amp;lt;&amp;lt; get selected columns();
found_list = {};
Show( target );
New Window( "Compilation",
	For( j = 1, j &amp;lt;= N Items( target ), j++,
		Notes = target[j] &amp;lt;&amp;lt; Get Property( "Notes" );
		If(
			Contains(
				Munger( Head Name( As Namespace( target[j] ) ), 0, 2 ),
				Xparam
			),
			Connected = Substitute( Head Name( As Namespace( target[j] ) ),
				Xparam, Yparam
			);
			Insert Into( found_list, Connected );
			Try(
				biv = Bivariate(
					Y( Column( dt, found_list[j] ) ),
					X( Column( dt, target[j] ) ),
					Automatic Recalc( 1 ),
					SendToReport(
						Dispatch(
							{},
							"Bivar Plot",
							FrameBox,
							{Frame Size( 470, 470 ),
							Add Text Annotation(
								Text( "Category: " || Notes ),
								Fixed Size( 0 ),
								Filled( 0 ),
								Font( "Segoe UI", 10, "Bold" )
							), Add Graphics Script(
								2,
								Description( "" ),
								Transparency( 0.5 );
								Pen Color( "Black" );
								Fill Color( "Red" );
								Oval( -100, -100, 100, 100, 1 );
								Pen Color( "Black" );
								Fill Color( "Green" );
								Oval( -90, -90, 90, 90, 1 );
								Pen Color( "Black" );
								Fill Color( "Blue" );
								Oval( -80, -80, 80, 80, 1 );
								Pen Color( "Black" );
								Line( [-110 0 110], [0 0 0] );
								Line( [0 0 0], [-110 0 110] );
								Oval( -80, -80, 80, 80 );
								Oval( -90, -90, 90, 90 );
								Oval( -100, -100, 100, 100 );
							)}
						)
					)
				);
				ms = Report( biv )[FrameBox( 1 )] &amp;lt;&amp;lt; Find Seg( Marker Seg( 1 ) );
				xs = ms &amp;lt;&amp;lt; Get X Values |/ 110;
				ys = ms &amp;lt;&amp;lt; Get Y Values |/ 110;
				x_there = Loc( !Is Missing( xs ) );
				y_there = Loc( !Is Missing( ys ) );
				ind = Associative Array( x_there );
				ind &amp;lt;&amp;lt; Intersect( Associative Array( y_there ) );
				ind = Matrix( ind &amp;lt;&amp;lt; Get Keys );
				xs = xs[ind];
				ys = ys[ind];
				val = Max( Max( Abs( xs ) ), Max( Abs( ys ) ) );
				xaxis = Report( biv )[AxisBox( 1 )];
				yaxis = Report( biv )[AxisBox( 2 )];
				xaxis &amp;lt;&amp;lt; Min( -1 * val ) &amp;lt;&amp;lt; Max( val );
				yaxis &amp;lt;&amp;lt; Min( -1 * val ) &amp;lt;&amp;lt; Max( val );
			);
		);
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 16:15:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Auto-Scaling/m-p/799986#M97575</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2024-09-18T16:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Scaling</title>
      <link>https://community.jmp.com/t5/Discussions/Auto-Scaling/m-p/800008#M97576</link>
      <description>&lt;P&gt;You can "pre-filter" your values, for example by getting non-excluded rows first&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");
dt &amp;lt;&amp;lt; Select Rows(Index(7, 11)) &amp;lt;&amp;lt; Hide and Exclude(1);


non_excluded_rows = dt &amp;lt;&amp;lt; get rows where(!Excluded());


m = Column(dt, "height") &amp;lt;&amp;lt; get values;

valid_m = m[non_excluded_rows];

N Items(valid_m);

show(valid_m, N Items(valid_m));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 16:24:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Auto-Scaling/m-p/800008#M97576</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-18T16:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Scaling</title>
      <link>https://community.jmp.com/t5/Discussions/Auto-Scaling/m-p/800040#M97577</link>
      <description>&lt;P&gt;Nice script as usual!&amp;nbsp; Some useful things for sure.&amp;nbsp; Because my original script is not operating on columns directly and I'm using an associative array (I'm new to those) I can't obviously see where to interrupt my code to make the modification?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 18:36:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Auto-Scaling/m-p/800040#M97577</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2024-09-18T18:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Scaling</title>
      <link>https://community.jmp.com/t5/Discussions/Auto-Scaling/m-p/800042#M97578</link>
      <description>&lt;P&gt;If marker segment still has those rows but excluded, you should be able to use them in similar manner as you would for values you get from columns. And if they aren't even there, then there should be nothing to worry about. If necessary you could also utilize &amp;lt;&amp;lt; Get Row Numbers with marker segment if it is available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also maybe you could just utilize the columns, values stored in those and ignore marker segment as you know the column names.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 18:50:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Auto-Scaling/m-p/800042#M97578</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-18T18:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Scaling</title>
      <link>https://community.jmp.com/t5/Discussions/Auto-Scaling/m-p/800087#M97584</link>
      <description>&lt;P&gt;Jarmo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I modified the script with your suggestions and it works except in a very isolated case where the data has an odd interdigitisation resulting from a transpose.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
dt &amp;lt;&amp;lt; Clear Column Selection();
colList = dt &amp;lt;&amp;lt; get column names( string );
check_list = {"VT", "ID", "DI", "IK", "GM"};
New Window( "Select Variables",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;On Validate( window:validated ),
	window:enable function = Function( {},
		{Default Local},
		X = window:lbMajor &amp;lt;&amp;lt; Get Selected;
		Y = window:lbMinor &amp;lt;&amp;lt; Get Selected;
		If( N Items( X ) &amp;amp; N Items( Y ) &amp;amp; X != Y,
			window:validated = 1,
			window:validated = 0
		);
		window:ok button &amp;lt;&amp;lt; Enable( window:validated );
	);
	H List Box(
		V List Box(
			Text Box( "Select X Variable" ),
			window:lbMajor = List Box(
				check_list,
				&amp;lt;&amp;lt;Set Max Selected( 1 ),
				enable function
			)
		),
		V List Box(
			Text Box( "Select Y Variable" ),
			window:lbMinor = List Box(
				check_list,
				&amp;lt;&amp;lt;Set Max Selected( 1 ),
				enable function
			)
		)
	);,
	H List Box(
		window:ok button = Button Box( "OK",
			X = window:lbMajor &amp;lt;&amp;lt; Get Selected;
			Y = window:lbMinor &amp;lt;&amp;lt; Get Selected;
			If( N Items( X ) &amp;amp; N Items( Y ) &amp;amp; X != Y,
				window:validated = 1,
				window:validated = 0
			);
			If( window:validated,
				Print( "Processing with X: " || Char( X ) || ", Y: " || Char( Y ) );
				Window( "Select Variables" ) &amp;lt;&amp;lt; Close Window;
			,
				Beep();
				Show( "Invalid Selection" );
				{window:lbMajor, window:lbMinor} &amp;lt;&amp;lt; Select;
				window:lbMajor &amp;lt;&amp;lt; Inval &amp;lt;&amp;lt; Update Window;
				Wait( 0.25 );
				{window:lbMajor, window:lbMinor} &amp;lt;&amp;lt; DeSelect;
				window:lbMajor &amp;lt;&amp;lt; Inval &amp;lt;&amp;lt; Update Window;
				Wait( 0.25 );
				{window:lbMajor, window:lbMinor} &amp;lt;&amp;lt; Select;
				window:lbMajor &amp;lt;&amp;lt; Inval &amp;lt;&amp;lt; Update Window;
				Wait( 0.25 );
				{window:lbMajor, window:lbMinor} &amp;lt;&amp;lt; DeSelect;
				window:lbMajor &amp;lt;&amp;lt; Inval &amp;lt;&amp;lt; Update Window;
			);,
			&amp;lt;&amp;lt;Enable( 0 )
		),
		Button Box( "Cancel", Throw( "!Canceled Analysis" ) )
	)
);
If(
	X[1] == "VT", Xparam = "VT",
	X[1] == "ID", Xparam = "ID",
	X[1] == "DI", Xparam = "DI",
	X[1] == "IK", Xparam = "IK",
	X[1] == "GM", Xparam = "GM"
);
If(
	Y[1] == "VT", Yparam = "VT",
	Y[1] == "ID", Yparam = "ID",
	Y[1] == "DI", Yparam = "DI",
	Y[1] == "IK", Yparam = "IK",
	Y[1] == "GM", Yparam = "GM"
);
Show( Xparam );
Show( Yparam );
For( i = 1, i &amp;lt;= N Cols( dt ), i++,
	If(
		Contains( Munger( Head Name( As Namespace( colList[i] ) ), 0, 2 ), Xparam )
		 &amp;amp; Contains(
			Head Name( As Namespace( colList[i] ) ),
			"% Delta From Target"
		),
		Column( colList[i] ) &amp;lt;&amp;lt; Set Selected( 1 )
	)
);
non_excluded_rows = dt &amp;lt;&amp;lt; get rows where(!Excluded());
target = dt &amp;lt;&amp;lt; get selected columns();
found_list = {};
Show( target );
New Window( "Compilation",
	For( j = 1, j &amp;lt;= N Items( target ), j++,
		Notes = target[j] &amp;lt;&amp;lt; Get Property( "Notes" );
		If(
			Contains(
				Munger( Head Name( As Namespace( target[j] ) ), 0, 2 ),
				Xparam
			),
			Connected = Substitute( Head Name( As Namespace( target[j] ) ),
				Xparam, Yparam
			);
			Insert Into( found_list, Connected );
			Try(
				biv = Bivariate(
					Y( Column( dt, found_list[j] ) ),
					X( Column( dt, target[j] ) ),
					Automatic Recalc( 1 ),
					SendToReport(
						Dispatch(
							{},
							"Bivar Plot",
							FrameBox,
							{Frame Size( 470, 470 ),
							Add Text Annotation(
								Text( "Category: " || Notes ),
								Fixed Size( 0 ),
								Filled( 0 ),
								Font( "Segoe UI", 10, "Bold" )
							), Add Graphics Script(
								2,
								Description( "" ),
								Transparency( 0.5 );
								Pen Color( "Black" );
								Fill Color( "Red" );
								Oval( -100, -100, 100, 100, 1 );
								Pen Color( "Black" );
								Fill Color( "Green" );
								Oval( -90, -90, 90, 90, 1 );
								Pen Color( "Black" );
								Fill Color( "Blue" );
								Oval( -80, -80, 80, 80, 1 );
								Pen Color( "Black" );
								Line( [-110 0 110], [0 0 0] );
								Line( [0 0 0], [-110 0 110] );
								Oval( -80, -80, 80, 80 );
								Oval( -90, -90, 90, 90 );
								Oval( -100, -100, 100, 100 );
							)}
						)
					)
				);
				ms = Report( biv )[FrameBox( 1 )] &amp;lt;&amp;lt; Find Seg( Marker Seg( 1 ) );
				xs = ms &amp;lt;&amp;lt; Get X Values |/ 110;
				ys = ms &amp;lt;&amp;lt; Get Y Values |/ 110;
				x_there = Loc( !Is Missing( xs[non_excluded_rows] ) );
				y_there = Loc( !Is Missing( ys[non_excluded_rows] ) );
				ind = Associative Array( x_there );
				ind &amp;lt;&amp;lt; Intersect( Associative Array( y_there ) );
				ind = Matrix( ind &amp;lt;&amp;lt; Get Keys );
				xs = xs[ind];
				ys = ys[ind];
				val = Max( Max( Abs( xs|/ 110 ) ), Max( Abs( ys|/ 110 ) ) );
				xaxis = Report( biv )[AxisBox( 1 )];
				yaxis = Report( biv )[AxisBox( 2 )];
				xaxis &amp;lt;&amp;lt; Min( -1 * val ) &amp;lt;&amp;lt; Max( val );
				yaxis &amp;lt;&amp;lt; Min( -1 * val ) &amp;lt;&amp;lt; Max( val );
			);
		);
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Sep 2024 22:11:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Auto-Scaling/m-p/800087#M97584</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2024-09-18T22:11:56Z</dc:date>
    </item>
  </channel>
</rss>

