cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

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

JSL: Row states assignment

I am still new to the row state idea and implementation.

 

 

Can anyone tell me the syntax for selecting the first 50 rows of a data table and applying radom markers(preferably variety of markers and colors) and colors as row states ?

 

I really appreciate it. Thank you

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: JSL: Row states assignment

Here is a sample script working on the Big Class sample data table.  I think it will give you an idea on how to do what you asked

names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");

// To color the first 20 rows, the rows outside of that
// limit need to be excluded from the coloring
dt << select where(Row()>20);
dt << hide and exclude(1);

dt << color or mark by column("sex", marker theme(hollow));
dt << color or mark by column("age");
dt << hide and exclude(0);
dt << clear select;
Jim

View solution in original post

Craige_Hales
Super User

Re: JSL: Row states assignment

 

 

dt = Open( "$sample_data/big class.jmp" );
// http://www.jmp.com/support/help/Row_State_Functions.shtml
dt << setrowstates(
	J( N Rows( dt ), 1/*cols*/,  
		Random Integer( 0, 15 ) * 16 // marker bits 4-7
		+ Random Integer( 0, 127 ) * 256 // color bits 8-14
	)
);

Data table with row states set to random colors and markersData table with row states set to random colors and markers

 

Craige

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: JSL: Row states assignment

Here is a sample script working on the Big Class sample data table.  I think it will give you an idea on how to do what you asked

names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");

// To color the first 20 rows, the rows outside of that
// limit need to be excluded from the coloring
dt << select where(Row()>20);
dt << hide and exclude(1);

dt << color or mark by column("sex", marker theme(hollow));
dt << color or mark by column("age");
dt << hide and exclude(0);
dt << clear select;
Jim
Craige_Hales
Super User

Re: JSL: Row states assignment

 

 

dt = Open( "$sample_data/big class.jmp" );
// http://www.jmp.com/support/help/Row_State_Functions.shtml
dt << setrowstates(
	J( N Rows( dt ), 1/*cols*/,  
		Random Integer( 0, 15 ) * 16 // marker bits 4-7
		+ Random Integer( 0, 127 ) * 256 // color bits 8-14
	)
);

Data table with row states set to random colors and markersData table with row states set to random colors and markers

 

Craige

Recommended Articles