cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
vishwasanj
Level V

Adjusting variables on Graph builder automatically

Hi All,

 

I have created a final table which has a bunch of columns. The data I want to plot start from 35th column every time. The number of columns I want to plot keeps varyign with every iteration. It could vary from 1 column to many columns.

 

What is the best way to plot with variables continuously changing? 

Is there a way to change the type of plot using an external variable like "plot_type" saying Linear or box?

Is there a way to change the log or linear plot with every iteration using a similar idea?

Below is an example with 5 columns. It doesn't work with any other number of columns.

 

collist = tdt << get column names();
Show( collist );
m = {};
b = 1;
For( z = 35, z <= N Cols( tdt ), z++,
	m[b] = Char( collist[z] );
	b = b + 1;
);
Show( m );

gbfc = tdt << Graph Builder(
	Size( 1515, 922 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Index ),
		X( :Name, Position( 1 ) ),
		X( :Wafers, Position( 1 ) ),
		Y( Column( tdt, m[1] ) ),
		Y( Column( tdt, m[2] ), Position( 1 ) ),
		Y( Column( tdt, m[3] ), Position( 1 ) ),
		Y( Column( tdt, m[4] ), Position( 1 ) ),
		Y( Column( tdt, m[5] ), Position( 1 ) )
	),
	Elements( Points( X( 1 ), Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Y( 5 ), Legend( 18 ) ) ),
	SendToReport( Dispatch( {}, "X title", TextEditBox, {Set Text( "Index / Lot / Wafers" )} ) )
);

Thank you so much.

3 REPLIES 3
txnelson
Super User

Re: Adjusting variables on Graph builder automatically

Here is an example of how to accomplish the dynamic plotting.

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

m = {};
b = 1;
collist = tdt << get column names();
For( z = 35, z <= N Cols( tdt ), z++,
	m[b] = Char( collist[z] );
	b = b + 1;
);

TheExpr =
"gbfc = tdt << Graph Builder(
	Size( 1515, 922 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Wafer ),
		Y( Column( tdt, m[1] ) )";
For( i = 2, i <= 5, i++,
	TheExpr = TheExpr || ",Y( Column( tdt, m[" || Char( i ) || "] ), Position( 1 ) )";
);
TheExpr = TheExpr ||
"),Elements( Points( X( 1 ), Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Y( 5 ), Legend( 18 ) ) ),
	SendToReport( Dispatch( {}, \!"X title\!", TextEditBox, {Set Text( \!"Index / Lot / Wafers\!" )} ) )
);";

Eval( Parse( TheExpr ) );

Concerning the changing of the type of plot or the axis values, JSL will allow you to structure any of these items. 

Jim
vishwasanj
Level V

Re: Adjusting variables on Graph builder automatically

Thank you txnelson. That works perfectly. I will try to figure out how to change the Limits on the Y axis, change the type of plot, and choose log or linear. If I embed all the 3 features into the same script, it will be pretty robust.
Craige_Hales
Super User

Re: Adjusting variables on Graph builder automatically

After Jim's script, you can further control the axes like this

outline = report(gbfc);
yaxis = outline[axisbox(2)];

yaxis<<min(-100);
yaxis<<max(60);

I use the outline's gray open/close triangle->right-click->Edit->ShowTreeStructure to discover axisbox 2 is the Y axis:

Pick ShowTree Structure from the outline. Then click part of the report to find it.Pick ShowTree Structure from the outline. Then click part of the report to find it.

Then I use the scripting index to look up AxisBox

Using the scripting index to find messages for an AxisBoxUsing the scripting index to find messages for an AxisBox

 

Craige

Recommended Articles