cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar

How to update Y-axis reference lines label in numeric value using JSL script (Automate plots with USL LSL label)

As title stated, How to update Y-axis reference lines label in numeric value using JSL script (Automate plots with USL LSL label)?

I am currently using JSL script to generate a series of plots from a set of data table, in order to show the distribution plots with USL/LSL limits in one click. And those limits showed in the plots are based on the Manage Limits table (I updated values). But one more step to improve is to show those USL/LSL label in actual numeric values based on the Manage Limits table, I coudn't find the relevant JSL commands to automate it except I have to update the labels manually one by one.. anyone know how to show some example? Thanks in advance.

 

JSL_labelling.png

 

	For( i = 1, i <= 100, i++,
		xCol = Column(dt, i);
		
		if ( Mod( i-8, 5 ) == 0,
		rowBox = hlistbox();
		win << Append( rowBox )			
		);
		rowBox << Append(
		//New Window( "training - Fit Y by X by Serial",
			//dt << Fit Group(
				Graph Builder(
					Size( 350, 350 ),
					Fit to Window("off"),
					Show Control Panel( 0 ),
					Show Title ( 1 ),
					Show Subtitle ( 0 ), 
					Show Legend( 1 ),
					Show Header ( 0 ),
					Show Footer ( 0 ),
					//Update Variable to Column Name
					Variables(X( :TEMP ),Y( xCol ),Overlay( :Unit )),
					Elements( Smoother( X, Y, Legend( 8 ) ), Points( X, Y, Legend( 9 ) ) ),
					SendToReport(
						Dispatch(
							{}, "Graph Builder", 
							OutlineBox, {Set Title( "" ), Image Export Display(Normal)},
						),
						Dispatch(
							{}, "Graph Builder", 
							FrameBox,{Transparency(0.8), Left( 0 ), Right( 0 ), Top( 1 ), Bottom( 1 )},
						)

//To update labels USL/LSL limits in numeric value
					)
				)
5 REPLIES 5
jthi
Super User

Re: How to update Y-axis reference lines label in numeric value using JSL script (Automate plots with USL LSL label)

This might give some ideas https://community.jmp.com/t5/Discussions/Change-Line-Color-and-Line-Style-in-all-platforms/m-p/81979...

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

ml = dt << Manage Limits(
	Process Variables(dt << Get Column Group("Processes")),
);
ml << Show Limits All;
ml << Save to Column Properties;
ml << Close Window;

dt << Distribution(
	Stack(1),
	Continuous Distribution(
		Column(:NPN1),
		Horizontal Layout(1),
		Vertical(0),
		Process Capability(Use Column Property Specs)
	)
);

// "Tool script" starts from here
// Names Default To Here(1);
abs = Current Report() << XPath("//AxisBox");
names = {"A", "B", "C", "D"};
idx = 0;
For Each({ab}, abs,
	s = ab << get script;
	For Each({cur_s}, s,
		If(Head Name(cur_s) == "Add Ref Line",
			l = Substitute(Name Expr(cur_s), Expr(Add Ref Line()), Expr(List()));
			If(Contains(l, "LSL") | Contains(l, "Target") | Contains(l, "USL"),
				// this isn't documented
				idx++;
				Eval(EvalExpr(
					ab << Update Ref Line(1, Expr(idx), "Solid", "Orange", names[idx], 3);
				));
			);
		);
	);
);

If it is just one specific platform and one axis, this can be most likely simplified

-Jarmo

Re: How to update Y-axis reference lines label in numeric value using JSL script (Automate plots with USL LSL label)

Thanks Jarmo. This is good in showing the plots in process capability way, it also showing the USL LSL instead of numeric value. I have the manage limit table updated already, just wish to have one more step to show those limits in numeric value in the plot via JSL script.

txnelson
Super User

Re: How to update Y-axis reference lines label in numeric value using JSL script (Automate plots with USL LSL label)

Here is a simple script that sets the Spec Limits for a column and then runs the Graph Builder, which automatically displays the Spec Limits

txnelson_0-1734764235477.png

Names Default To Here( 1 );
dt = 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );

htUSL = 66;
htLSL = 55;

Eval(
	Eval Expr(
		dt:height << set property(
			"spec limits",
			{LSL( Expr( htLSL ) ), USL( Expr( htUSL ) ), Show Limits( 1 )}
		)
	)
);

dt << Graph Builder(
	Size( 534, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);

Jim

Re: How to update Y-axis reference lines label in numeric value using JSL script (Automate plots with USL LSL label)

Thanks nelson, the code is similar to my code and it also can't show the reference lines of USL LSL in numeric value.

I tried use the Num(htUSL) to change it in numeric value but it generate the plot without reference lines at all, which we will have to use Expr (htUSL) to show the lines. It seems there is no other option to show those limits in numeric value via JSL script, except in manual way..

 

htUSL = 66;
htLSL = 55;

Eval(
	Eval Expr(
		dt:height << set property(
			"spec limits",
			{LSL( Expr( htLSL ) ), USL( Expr( htUSL ) ), Show Limits( 1 )},
			{LSL( Num( htLSL ) ), USL( Num( htUSL ) ), Show Limits( 1 )}, //Not working
		)
	)
);
txnelson
Super User

Re: How to update Y-axis reference lines label in numeric value using JSL script (Automate plots with USL LSL label)

Why are you using 2 lists in the Set Property("Spec Limits") function?  Only one set of limits are permitted for Spec Limits.  Additionally, the Eval( EvalExpr() function looks for Expr() in the enclosed function, and expands the value of each Expr() and then the Eval() function can properly evaluate it.  In your second Spec Limits specification, you replaced the Expr() with Num().  because it is inside of a JMP List, no evaluation of it or the htLSL and the htUSL will be evaluated, thus what is passed to JSL will be unknown to JMP.

If you are attempting to run more than one column, each column will have to have their spec limits separately. 

 

Have you run my example....without change?  If so, does it produce a graph with USL and LSL reference lines?

Jim