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

For loop

I would like to generate all these plots in one tab, rather than generating 50 different pages, can anyone help ? thank you 

dt = Current Data Table();
For( i = 1, i <= 50, i++,
	dt << Bivariate(
		Y( Column( dt, "u" || Char( i ) ) ),
		X( Column( dt, "oven.T" ) ),
		Fit Line( {Line Color( {212, 73, 88} )} )
	)
);

 

2 REPLIES 2
txnelson
Super User

Re: For loop

Here is one way to do what you want

Names Default To Here( 1 );
dt = 
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
colListY = {};
For( i = 1, i <= 10, i++,
	Insert Into( colListY, "NPN" || Char( i ) )
);

dt << Bivariate(
	Y( Eval( colListY ) ),
	X( Column( dt, "PNP1" ) ),
	Fit Line( {Line Color( {212, 73, 88} )} )
);

Here is another way

Names Default To Here( 1 );
dt = 
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
colListY = {};
For( i = 1, i <= 10, i++,
	Insert Into( colListY, "NPN" || Char( i ) )
);
New Window( "My Output",
	H List Box(
		For( i = 1, i <= 10, i++,
			dt << Bivariate(
				Y( Column( dt, colListY[i] ) ),
				X( Column( dt, "PNP1" ) ),
				Fit Line( {Line Color( {212, 73, 88} )} )
			)
		)
	)
);
Jim

Re: For loop

Thank you!

 

Recommended Articles