cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
RonSwanson
Level I

Script multiple columns grouped in distribution plot

I'm trying to script a way to plot multiple parameter columns that are grouped together in a distribution (as shown in figure). My problem is the code needs a separate "Continuous Distribution" row for each parameter column. My data pulls have different column names and number of columns to plot depending on what I'm doing. I can't figure out how to take that column name list and have it plotted in a group as show below, rather than looping through and creating individual plots for each parameter.

 

 

Distribution(
	Continuous Distribution( Column( :Parameter1 ) ),
	Continuous Distribution( Column( :Parameter2 ) ),
	Continuous Distribution( Column( :Parameter3 ) )
);

image.png

 

11 REPLIES 11
spudton
Level III

Re: Script multiple columns grouped in distribution plot

Noted, I think that my assumption that everything starts with an application has caused me much pain.

One more question, hopefully, If I want to set the properties of all the distributions in a report, as I've done with this single variable here, "T05066DD ET_DELTA Ratio" is there a simple command to do it, or do i need to build a for loop and run the "sendtoreport" for each variable in my list?

ET_DELTA_List = {};
dist = dt << Distribution(Columns(evalList(ET_DELTA_List))); dist << arrange in rows(5); dist << Quantiles(0); dist << Summary Statistics(0); report(dist)[OutlineBox(2)] << Open all like this(1); //show properties(dist) dist << SendToReport( Dispatch( {"T05066DD ET_DELTA Ratio"},//this is one of many distributions. i would like to set the following properties to all the distributions in the report "1", ScaleBox, {Min( -5 ), Max( 5 ), Inc( 5000 ), Minor Ticks( 1 ), Add Ref Line( 2, "Solid", "Black", "", 1 ), Add Ref Line( -2, "Solid", "Black", "", 1 )} ) )

 

txnelson
Super User

Re: Script multiple columns grouped in distribution plot

Here is how I would handle the issue

names default to here(1);
dt=open("$SAMPLE_DATA/semiconductor capability.jmp");

colList = dt << get column names(continuous,string);
// For this illustration I want to use just the NPNn columns
for(i=nitems(colList), i>=1,i--,
	If(substr(colList[i],1,3)!="NPN", remove from(colList,i,1))
);

// build the JSL string
theExpr = 
"Dis = Distribution(
		Continuous Distribution( Column( :" || colList[1] || " ), 
		Process Capability( Use Column Property Specs ) )";
For( i = 2, i <= N Items( colList ), i++,
	theExpr = theExpr || "," || "Continuous Distribution( Column( :" || colList[i] ||
	" ), Process Capability( Use Column Property Specs ) )"
);
theExpr=theExpr||");";

// run the built JSL string
eval(parse(theexpr));

// Standardize the settings
disr = Dis << report;

disr[colList[1]]["Quantiles"]<<close all like this;
disr[colList[1]]["Summary Statistics"]<<close all like this;
disr[colList[1]]["Process Capability"]<<close all like this;

For(i=1,i<=nitems(colList),i++,
	disr[colList[i]][AxisBox(1)] << min(87) << max(127) << inc(5)
	<< Add Ref Line( 121, "Solid","Black","",1)
	<< Add Ref Line( 100, "Solid", "Black", "", 1 )
	<< Add Ref Line( 90, "Solid", "Black", "", 1 )
);
Jim