Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
chungman89
Level I

JSL script on graph builder box plot all column against wafer number

Hello, I am trying to plot my data (multiple parameters) against the wafer number. I have found a script from the community for the distribution graph. Therefore, I have modified it by replacing Distribution function with Graph Builder function. However, only one graph was shown at the report instead of all the graphs. Can I have you advice on this script? Thank you.

 

dt = Current Data Table ();

// Get all of the continuous data columns
colNames = dt << get column names( string, continuous );

// Create the JSL to create the script
theExpr = "Graph Builder(
	Size( 1414, 795 ),
	Show Control Panel( 0 ),
	Variables( X( :WF_NUM ), Y( colNames[1] ), Color( :WF_NUM ) ),
	Elements( Box Plot( X, Y, Legend( 7 ) ) )
);
)";

For( i = 1, i <= N Items( colNames ), i++,
	theExpr = theExpr || ", Graph Builder(
	Size( 1414, 795 ),
	Show Control Panel( 0 ),
	Variables( X( :WF_NUM ), Y(colNames[" || Char( i ) || "] ), Color( :WF_NUM ) ),
	Elements( Box Plot( X, Y, Legend( 7 ) ) )
)");

// place the closing ")" to complete the command string
theExpr = theExpr || ");";

// Run the created JSL
Eval(Parse(theExpr));

Thank you for your help.

 

Dominic

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: JSL script on graph builder box plot all column against wafer number

The JSL you provided can be simplified  to produce the charts you want.  Below is a modification of your code 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

// Change the name of the Wafer column to match the name used
// in the Graph Builder code
dt:wafer << set name( "WF_NUM" );
colNames = dt << get column names( string, continuous ); // Since there are 128 columns that could be plotted, the code has been // modified to just produce 3 of the plots. The commented out code // should replace the "i <= 3, i++," to plot all graphs For( i = 1, i <= 3, i++, // N Items( colNames ), i++, dt << Graph Builder( Size( 1414, 795 ), Show Control Panel( 0 ), Variables( X( :WF_NUM ), Y( As Column( dt, colNames[i] ) ), Color( :WF_NUM ) ), Elements( Box Plot( X, Y, Legend( 7 ) ) ) ) );

wafer.PNG

Jim

View solution in original post

4 REPLIES 4
Highlighted
txnelson
Super User

Re: JSL script on graph builder box plot all column against wafer number

The JSL you provided can be simplified  to produce the charts you want.  Below is a modification of your code 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

// Change the name of the Wafer column to match the name used
// in the Graph Builder code
dt:wafer << set name( "WF_NUM" );
colNames = dt << get column names( string, continuous ); // Since there are 128 columns that could be plotted, the code has been // modified to just produce 3 of the plots. The commented out code // should replace the "i <= 3, i++," to plot all graphs For( i = 1, i <= 3, i++, // N Items( colNames ), i++, dt << Graph Builder( Size( 1414, 795 ), Show Control Panel( 0 ), Variables( X( :WF_NUM ), Y( As Column( dt, colNames[i] ) ), Color( :WF_NUM ) ), Elements( Box Plot( X, Y, Legend( 7 ) ) ) ) );

wafer.PNG

Jim

View solution in original post

Highlighted
chungman89
Level I

Re: JSL script on graph builder box plot all column against wafer number

Hello @txnelson ,

 

Thank you for your reply.

 

The graphs were plotted with your modified code. One extra question regarding the modified codes. When I was using the reference code from the community for distribution graphs, all the graphs were summarised into a single report which make it easy to export to powerpoint. May I ask what extra lines are needed for the code you have simplified to summarised graphs into a single report?

 

Thank you for your help.


Dominic

Highlighted
txnelson
Super User

Re: JSL script on graph builder box plot all column against wafer number

All that needs to be done is to place the graph generations inside a New Window() function.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

// Change the name of the Wafer column to match the name used
// in the Graph Builder code
dt:wafer << set name( "WF_NUM" );

colNames = dt << get column names( string, continuous );

nw = New Window( "Graphs", 

// Since there are 128 columns that could be plotted, the code has been
	// modified to just produce 3 of the plots.  The commented out code
	// should replace the "i <= 3, i++," to plot all graphs
	For( i = 1, i <= 3, i++, // N Items( colNames ), i++,
		dt << Graph Builder(
			Size( 1414, 795 ),
			Show Control Panel( 0 ),
			Variables(
				X( :WF_NUM ),
				Y( As Column( dt, colNames[i] ) ),
				Color( :WF_NUM )
			),
			Elements( Box Plot( X, Y, Legend( 7 ) ) )
		),

	);

);
Jim
Highlighted
chungman89
Level I

Re: JSL script on graph builder box plot all column against wafer number

Thank you for your help @txnelson 

 

Appreciate the answer with details and code.

Article Labels