<?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: Automatically plot the associated columns in an Associative Array in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Automatically-plot-the-associated-columns-in-an-Associative/m-p/849136#M102503</link>
    <description>&lt;P&gt;Jarmo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Worked great!&amp;nbsp; Tweaked it a bit to allow input selection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
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"};
check_list2 = {"0", "1", "2", "3", "8"};
New Window( "Select Variables",
	&amp;lt;&amp;lt;Type( "Modal Dialog" ),
	&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;
		Voltage = window:lbVolt &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
			)
		),
		V List Box(
			Text Box( "Select Voltage" ),
			window:lbVolt = List Box(
				check_list2,
				&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;
			Voltage = window:lbVolt &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" ) )
	)
);
Show( X );
Show( Y );
Show( Voltage );

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"
);
If(
	Voltage[1] == "0", Vnode = "0",
	Voltage[1] == "1", Vnode = "1",
	Voltage[1] == "2", Vnode = "2",
	Voltage[1] == "3", Vnode = "3",
	Voltage[1] == "8", Vnode = "8"
);
Show( Xparam );
Show( Yparam );

startchar1 = Xparam;
startchar2 = Yparam;

rgx_startchar1 = Eval Insert("^startchar1^(.+?)$");

dt = Current Data Table();

collist = dt &amp;lt;&amp;lt; get column names(string);

//Paranmeter Group Filter

VT_IDcols1 = {};

For( i = 1, i &amp;lt;= N Items( collist ), i++,
If( !Contains( collist[i], "Pass/Fail"), If( Contains(  collist[i], Xparam) | Contains( collist[i], Yparam)  , Insert Into( VT_IDcols1, collist[i] ))));

//Voltage Filter

VT_IDcols = {};

For( i = 1, i &amp;lt;= N Items( VT_IDcols1 ), i++,
	If(	Contains( Munger( Head Name( As Namespace( VT_IDcols1[i] ) ), 0, 4 ), Vnode), Insert Into( VT_IDcols, VT_IDcols1[i] )
	)
);

aa = Associative Array();
For Each({colname}, VT_IDcols,
	col_ptrn = Regex(colname, rgx_startchar1, "\1");
	If(!IsMissing(col_ptrn), // starts with VT and ends with H
		If(Contains(VT_IDcols, startchar2 || col_ptrn ),
			aa[startchar1 || col_ptrn] = startchar2 || col_ptrn;
		);
	);
);

show(aa);

// Plotting
lub = Lineup Box(N Col(2));

For Each({{xcol, ycol}}, aa,
	lub &amp;lt;&amp;lt; Append(dt &amp;lt;&amp;lt; Bivariate(Y(Eval(xcol)), X(Eval(ycol))));
);

nw = new window("",
	lub
);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 21 Mar 2025 18:30:50 GMT</pubDate>
    <dc:creator>SpannerHead</dc:creator>
    <dc:date>2025-03-21T18:30:50Z</dc:date>
    <item>
      <title>Automatically plot the associated columns in an Associative Array</title>
      <link>https://community.jmp.com/t5/Discussions/Automatically-plot-the-associated-columns-in-an-Associative/m-p/849058#M102488</link>
      <description>&lt;P&gt;With a lot of help from Jarmo, I got an Associative Array (aa) of columns that are linked.&amp;nbsp; Next, I need to plot those, is that easily done&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

startchar1 = "VT";
startchar2 = "ID";

rgx_startchar1 = Eval Insert("^startchar1^(.+?)$");

dt = Current Data Table();

collist = dt &amp;lt;&amp;lt; get column names(string);

VT_IDcols = {};

For( i = 1, i &amp;lt;= N Items( collist ), i++,
If( !Contains( collist[i], "Pass/Fail"), If( Contains(  collist[i], "VT") | Contains( collist[i], "ID")  , Insert Into( VT_IDcols, collist[i] ))));

aa = Associative Array();
For Each({colname}, VT_IDcols,
	col_ptrn = Regex(colname, rgx_startchar1, "\1");
	If(!IsMissing(col_ptrn), // starts with VT and ends with H
		If(Contains(VT_IDcols, startchar2 || col_ptrn ),
			aa[startchar1 || col_ptrn] = startchar2 || col_ptrn;
		);
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Mar 2025 15:10:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automatically-plot-the-associated-columns-in-an-Associative/m-p/849058#M102488</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-03-21T15:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically plot the associated columns in an Associative Array</title>
      <link>https://community.jmp.com/t5/Discussions/Automatically-plot-the-associated-columns-in-an-Associative/m-p/849079#M102490</link>
      <description>&lt;P&gt;How you wish to plot those?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

endchar1 = "1";
endchar2 = "2";

rgx_endchar1 = Eval Insert("(.+?)^endchar1^$");

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");


collist = dt &amp;lt;&amp;lt; get column names(string);

aa = Associative Array();
For Each({colname}, collist,
	col_ptrn = Regex(colname, rgx_endchar1, "\1");
	If(!Is Missing(col_ptrn), // ends with H
		If(Contains(collist, col_ptrn || endchar2),
			aa[col_ptrn || endchar1] = col_ptrn || endchar2
		)
	);
);


// Plotting
lub = Lineup Box(N Col(2));

For Each({{xcol, ycol}}, aa,
	lub &amp;lt;&amp;lt; Append(dt &amp;lt;&amp;lt; Bivariate(Y(Eval(xcol)), X(Eval(ycol))));
);

nw = new window("",
	lub
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Mar 2025 15:25:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automatically-plot-the-associated-columns-in-an-Associative/m-p/849079#M102490</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-03-21T15:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically plot the associated columns in an Associative Array</title>
      <link>https://community.jmp.com/t5/Discussions/Automatically-plot-the-associated-columns-in-an-Associative/m-p/849136#M102503</link>
      <description>&lt;P&gt;Jarmo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Worked great!&amp;nbsp; Tweaked it a bit to allow input selection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
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"};
check_list2 = {"0", "1", "2", "3", "8"};
New Window( "Select Variables",
	&amp;lt;&amp;lt;Type( "Modal Dialog" ),
	&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;
		Voltage = window:lbVolt &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
			)
		),
		V List Box(
			Text Box( "Select Voltage" ),
			window:lbVolt = List Box(
				check_list2,
				&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;
			Voltage = window:lbVolt &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" ) )
	)
);
Show( X );
Show( Y );
Show( Voltage );

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"
);
If(
	Voltage[1] == "0", Vnode = "0",
	Voltage[1] == "1", Vnode = "1",
	Voltage[1] == "2", Vnode = "2",
	Voltage[1] == "3", Vnode = "3",
	Voltage[1] == "8", Vnode = "8"
);
Show( Xparam );
Show( Yparam );

startchar1 = Xparam;
startchar2 = Yparam;

rgx_startchar1 = Eval Insert("^startchar1^(.+?)$");

dt = Current Data Table();

collist = dt &amp;lt;&amp;lt; get column names(string);

//Paranmeter Group Filter

VT_IDcols1 = {};

For( i = 1, i &amp;lt;= N Items( collist ), i++,
If( !Contains( collist[i], "Pass/Fail"), If( Contains(  collist[i], Xparam) | Contains( collist[i], Yparam)  , Insert Into( VT_IDcols1, collist[i] ))));

//Voltage Filter

VT_IDcols = {};

For( i = 1, i &amp;lt;= N Items( VT_IDcols1 ), i++,
	If(	Contains( Munger( Head Name( As Namespace( VT_IDcols1[i] ) ), 0, 4 ), Vnode), Insert Into( VT_IDcols, VT_IDcols1[i] )
	)
);

aa = Associative Array();
For Each({colname}, VT_IDcols,
	col_ptrn = Regex(colname, rgx_startchar1, "\1");
	If(!IsMissing(col_ptrn), // starts with VT and ends with H
		If(Contains(VT_IDcols, startchar2 || col_ptrn ),
			aa[startchar1 || col_ptrn] = startchar2 || col_ptrn;
		);
	);
);

show(aa);

// Plotting
lub = Lineup Box(N Col(2));

For Each({{xcol, ycol}}, aa,
	lub &amp;lt;&amp;lt; Append(dt &amp;lt;&amp;lt; Bivariate(Y(Eval(xcol)), X(Eval(ycol))));
);

nw = new window("",
	lub
);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Mar 2025 18:30:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Automatically-plot-the-associated-columns-in-an-Associative/m-p/849136#M102503</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-03-21T18:30:50Z</dc:date>
    </item>
  </channel>
</rss>

