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

Rescaling Y-axis in Control Charts based on LSL or USL in JMP

Hello everyone,

I've been working on control charts in JMP and I'm looking to rescale the Y-axis based on the Lower Specification Limit (LSL) or Upper Specification Limit (USL). Could someone guide me on how to achieve this in JMP? I want the Y-axis to dynamically adjust based on the LSL or USL to better visualize the data in relation to the specification limits.

 

Thank you in advance!

6 REPLIES 6
jthi
Super User

Re: Rescaling Y-axis in Control Charts based on LSL or USL in JMP

Have those (LSL and/or USL) been set to spec limit column properties? If not, how does your data look like and where are the limits stored?

-Jarmo

Re: Rescaling Y-axis in Control Charts based on LSL or USL in JMP

Yes the LSL and USL been set to spec limit column properties. 

his is achieved using the set property function on the columns of the dtsplitcopy data table. The script retrieves the limit values from another table (pIDlimits_copy) and then uses these values to set the spec limits and control limits for the corresponding columns in dtsplitcopy using the set property function.

Re: Rescaling Y-axis in Control Charts based on LSL or USL in JMP

Here is the part of the script : 
		// Get the column names from the split data table, which are really the different release results
		cols = dtsplitcopy << get column names( string );

		// Loop across the split data table and read the values for that column from the dt_limits_copy data table. Populate the Spec Limits and Control Limits
		For( i = 1, i <= N Cols( dtsplitcopy ), i++, 

			   limrow = Try( (pIDlimits_copy << get rows where( pIDlimits_copy:labelny == cols[i] ))[1], . ); 

			   If( Is Missing( limRow ) == 0, 
					specs = {LSL( . ), USL( . ), Target( . ), Show Limits( 1 )}; 

					specs["LSL"] = pIDlimits_copy:Lower Limit Value[limrow]; 
					specs["USL"] = pIDlimits_copy:Upper Limit value[limrow]; 
					
					Column( dtsplitcopy, Char( cols[i] ) ) << set property( "spec limits", Eval( specs ) ); 

					controllimits = {Individual Measurement( Avg( a ), LCL( b ), UCL( c ) )}; 
					
					// If lower limit is missing it is set to mean - (UCL - mean) = 2*mean - UCL as this will fix issues with zones otherwise being wrong if set to missing
					Substitute Into( controllimits, Expr( b ), if(ismissing(pIDlimits_copy:Lower_Control_Limit[limrow]), 2*pIDlimits_copy:Mean_Plot[limrow] - pIDlimits_copy:Upper_Control_Limit[limrow], pIDlimits_copy:Lower_Control_Limit[limrow])); // this is done to get correct zones
					Substitute Into( controllimits, Expr( c ), pIDlimits_copy:Upper_Control_Limit[limrow] ); 
					Substitute Into( controllimits, Expr( a ), pIDlimits_copy:Mean_Plot[limrow] ); 
					
					Column( dtsplitcopy, Char( cols[i] ) ) << set property( "control limits", Eval( controllimits ) );
					// These notes are added so that later we can choose to hide the "artificial lower limits" which is only included for the zones to be correct
					Column( dtsplitcopy, char( cols[i] ) ) << set property( "notes", if(ismissing(pIDlimits_copy:Lower_Control_Limit[limrow]),"Only one limit","Two limits")); 
			   ); 
		);
		
		dtsplitcopy << sort( by( Date ), Replace Table );

		n_vars = N Items(cols);
		// Create window for a control chart for all parameters of a given product from a given site
		NW = New Window(sitename || " " || prod_ID || " Report",
			For( v = 39, v <= n_vars, v += 1, //changed from column 38 to 39 to avoid 'Date' being printet as well. 
				
				tmp = :column(v) << get property("notes");
				
				Control Chart Builder(
					Show Two Shewhart Charts( 0 ),
					Show Control Panel( 0 ),
					Include Missing Categories( 0 ),
					Name( "AIAG (Ppk) Labeling" )(1),
					Variables( Y( :Column(v)) ),
					Chart(
						Points( Statistic( "Individual" ) ),
						Limits( Show Lower Limit( tmp == "Two limits" ), Sigma( "Moving Range" ), Zones( 1 ) ),
						Warnings( Test 1( 0 ), Test 5( 1 ), Test Beyond Limits( 1 ) )
					),
				)
			);
			
			vlb = V List Box( ob = Outline Box("Cpk estimates and print of data") )
		);
		
jthi
Super User

Re: Rescaling Y-axis in Control Charts based on LSL or USL in JMP

What type of scaling are you looking for? If I remember correctly control chart builder does scale based on specification limits if they have been set.

-Jarmo

Re: Rescaling Y-axis in Control Charts based on LSL or USL in JMP

For example in this control chart start the scale from 150 instead from 0. I would th y axis to change proportional with the LSL and USL

jthi
Super User

Re: Rescaling Y-axis in Control Charts based on LSL or USL in JMP

This might give some ideas

Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");

colname = "height";

Column(dt, colname) << Set Property("Spec Limits", {LSL(30), USL(100), Show Limits(1)});

ccb = dt << Control Chart Builder(
	Variables(Y(Eval(colname))),
	Chart(Position(1), Limits(Spec Limits(1))),
	Show Control Panel(0)
);

specs = Column(dt, colname) << Get Property("Spec Limits");

Report(ccb)[AxisBox(2)] << Min(specs["LSL"]) << Max(specs["USL"]);
-Jarmo