cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
SpannerHead
Level IV

Automatically plot associated columns

I have a data table containing voltage values associated with a structure of a particular size.  I also have a column describing the current resulting from the applied voltage for the same structure size.  When there are a large quantity of such columns, is there a way to have the columns that are related be plotted without any of the other unassociated plots being generated as a result?  I can of course plot them all and minimise the ones that don't associate but I wondered if Regex or the likes could simplify the task?


Slán



SpannerHead
1 ACCEPTED SOLUTION

Accepted Solutions
SpannerHead
Level IV

Re: Automatically plot associated columns

I figured this one out I think.  Excuse the clumsy check list boxes, they need a lot of work but otherwise, the formula associates the selected metrics by matching the characters beyond the first 3.  I can ensure the voltage threshold plots only against the relevant current for instance while also assessing multiple metrics in a single process.

 

SpannerHead

dt = Current Data Table();
dt << Clear Column Selection();
colList = dt << get column names( string );
check_list1 = {"VTX", "VTN", "VTP", "VTF", "IDS", "IBB", "ILK", "CMI"};
check_list2 = {"VTX", "VTN", "VTP", "VTF", "IDS", "IBB", "ILK", "CMI"};
nw = New Window( "X Value",
	<<modal(),
	my_cb = Check Box( check_list1 ),
	Panel Box( "Actions",
		H List Box(
			Button Box( "OK",
				keep_going = 1;
				X = my_cb << get selected;
			),
			Button Box( "Cancel", keep_going = 0 )
		)
	)
);
nw = New Window( "Y Value",
	<<modal(),
	my_other_cb = Check Box( check_list2 ),
	Panel Box( "Actions",
		H List Box(
			Button Box( "OK",
				keep_going = 1;
				Y = my_other_cb << get selected;
			),
			Button Box( "Cancel", keep_going = 0 )
		)
	)
);
Show( X );
Show( Y );
If(
	X[1] == "VTX", Xparam = "VTX",
	X[1] == "VTN", Xparam = "VTN",
	X[1] == "VTP", Xparam = "VTP",
	X[1] == "IDS", Xparam = "IDS",
	X[1] == "IBB", Xparam = "IBB",
	X[1] == "VTF", Xparam = "VTF",
	X[1] == "ILK", Xparam = "ILK",
	X[1] == "CMI", Xparam = "CMI"
);
If(
	Y[1] == "VTX", Yparam = "VTX",
	Y[1] == "VTN", Yparam = "VTN",
	Y[1] == "VTP", Yparam = "VTP",
	Y[1] == "IDS", Yparam = "IDS",
	Y[1] == "IBB", Yparam = "IBB",
	Y[1] == "VTF", Yparam = "VTF",
	Y[1] == "ILK", Yparam = "ILK",
	Y[1] == "CMI", Yparam = "CMI"
);
Show( Xparam );
Show( Yparam );
For( i = 1, i <= N Cols( dt ), i++,
	If( Contains( Munger( Head Name( As Namespace( colList[i] ) ), 0, 3 ), Xparam ),
		Column( colList[i] ) << Set Selected( 1 )
	)
);
target = dt << get selected columns();
found_list = {};
Show( target );
New Window( "Compilation",
	For( j = 1, j <= N Items( target ), j++,
		If(
			Contains(
				Munger( Head Name( As Namespace( target[j] ) ), 0, 3 ),
				Xparam
			) & !Contains( Head Name( As Namespace( target[j] ) ), "Pass/Fail" ),
			Connected = Substitute( Head Name( As Namespace( target[j] ) ),
				Xparam, Yparam
			);
			Insert Into( found_list, Connected );
			Try(
				Bivariate(
					Y( Column( dt, found_list[j] ) ),
					X( Column( dt, target[j] ) ),
					Automatic Recalc( 1 )
				)
			);
		)
	)
);

Thanks for the suggestions

 

 


Slán



SpannerHead

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: Automatically plot associated columns

it would be helpful to have a sample data table, and a mockup of what you want the graph to look like.

Jim
hogi
Level XII

Re: Automatically plot associated columns

What you describe sound like the Local Data Filter ...

 

[edit]

Oh, sorry, it doesn't 

SpannerHead
Level IV

Re: Automatically plot associated columns

I figured this one out I think.  Excuse the clumsy check list boxes, they need a lot of work but otherwise, the formula associates the selected metrics by matching the characters beyond the first 3.  I can ensure the voltage threshold plots only against the relevant current for instance while also assessing multiple metrics in a single process.

 

SpannerHead

dt = Current Data Table();
dt << Clear Column Selection();
colList = dt << get column names( string );
check_list1 = {"VTX", "VTN", "VTP", "VTF", "IDS", "IBB", "ILK", "CMI"};
check_list2 = {"VTX", "VTN", "VTP", "VTF", "IDS", "IBB", "ILK", "CMI"};
nw = New Window( "X Value",
	<<modal(),
	my_cb = Check Box( check_list1 ),
	Panel Box( "Actions",
		H List Box(
			Button Box( "OK",
				keep_going = 1;
				X = my_cb << get selected;
			),
			Button Box( "Cancel", keep_going = 0 )
		)
	)
);
nw = New Window( "Y Value",
	<<modal(),
	my_other_cb = Check Box( check_list2 ),
	Panel Box( "Actions",
		H List Box(
			Button Box( "OK",
				keep_going = 1;
				Y = my_other_cb << get selected;
			),
			Button Box( "Cancel", keep_going = 0 )
		)
	)
);
Show( X );
Show( Y );
If(
	X[1] == "VTX", Xparam = "VTX",
	X[1] == "VTN", Xparam = "VTN",
	X[1] == "VTP", Xparam = "VTP",
	X[1] == "IDS", Xparam = "IDS",
	X[1] == "IBB", Xparam = "IBB",
	X[1] == "VTF", Xparam = "VTF",
	X[1] == "ILK", Xparam = "ILK",
	X[1] == "CMI", Xparam = "CMI"
);
If(
	Y[1] == "VTX", Yparam = "VTX",
	Y[1] == "VTN", Yparam = "VTN",
	Y[1] == "VTP", Yparam = "VTP",
	Y[1] == "IDS", Yparam = "IDS",
	Y[1] == "IBB", Yparam = "IBB",
	Y[1] == "VTF", Yparam = "VTF",
	Y[1] == "ILK", Yparam = "ILK",
	Y[1] == "CMI", Yparam = "CMI"
);
Show( Xparam );
Show( Yparam );
For( i = 1, i <= N Cols( dt ), i++,
	If( Contains( Munger( Head Name( As Namespace( colList[i] ) ), 0, 3 ), Xparam ),
		Column( colList[i] ) << Set Selected( 1 )
	)
);
target = dt << get selected columns();
found_list = {};
Show( target );
New Window( "Compilation",
	For( j = 1, j <= N Items( target ), j++,
		If(
			Contains(
				Munger( Head Name( As Namespace( target[j] ) ), 0, 3 ),
				Xparam
			) & !Contains( Head Name( As Namespace( target[j] ) ), "Pass/Fail" ),
			Connected = Substitute( Head Name( As Namespace( target[j] ) ),
				Xparam, Yparam
			);
			Insert Into( found_list, Connected );
			Try(
				Bivariate(
					Y( Column( dt, found_list[j] ) ),
					X( Column( dt, target[j] ) ),
					Automatic Recalc( 1 )
				)
			);
		)
	)
);

Thanks for the suggestions

 

 


Slán



SpannerHead
GregF_JMP
Staff

Re: Automatically plot associated columns

Hello-

It sounds like you have found a workable solution- that's great.  There are usually several ways to approach a problem, and sometimes others can benefit from tips/tricks learned here.

>>I will admit that I was unsure of the exact problem from your description, a sample illustration would have been helpful.
Some thoughts on "a" problem (if it incorrectly matches yours- perhaps others will find some use).

GregF_JMP_0-1716560144730.png

Column Select has filter options under the red Triangle

GregF_JMP_1-1716560236689.png

Depending on the nature of your column names- the search may allow groups of the type you desire.

GregF_JMP_2-1716560286392.png