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
PhiIippe
Level II

Change Row marker shape through JSL

Hi,

 

I have a few scripts which generate graphs that look like this:

PhiIippe_0-1582442779938.png

But I would like it to always look like this:

PhiIippe_1-1582442899673.png

How can I do this using JSL?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
pmroz
Super User

Re: Change Row marker shape through JSL

You can also set the marker in the graph by right-clicking on the marker in the legend, and selecting Marker > +.  You need to do this for all the markers.  Then click the red triangle save the script somewhere.  It will look like this:

dt = New Table( "Untitled", Add Rows( 11 ),
	New Column( "X Value", Character, "Nominal",
		Set Values(
			{"02", "02", "02", "03", "03", "03", "04", "04", "05", "05", "05"}
		)
	),
	New Column( "Y Value", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [100, 120, 130, 110, 105, 108, 200, 220, 201, 190, 195] )
	)
);

dt << Graph Builder(
	Size( 528, 448 ),
	Show Control Panel( 0 ),
	Variables( X( :X Value ), Y( :Y Value ), Overlay( :X Value ) ),
	Elements( Points( X, Y, Legend( 14 ), Jitter( "None" ) ) ),
	SendToReport(
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				14,
				Properties( 0, {Marker( "Plus" )}, Item ID( "02", 1 ) ),
				Properties( 1, {Marker( "Plus" )}, Item ID( "03", 1 ) ),
				Properties( 2, {Marker( "Plus" )}, Item ID( "04", 1 ) ),
				Properties( 3, {Marker( "Plus" )}, Item ID( "05", 1 ) ),
				Properties( -1, {Marker( "Plus" )}, Item ID( "Y Value", 1 ) )
			)}
		)
	)
);

View solution in original post

4 REPLIES 4
Highlighted

Re: Change Row marker shape through JSL

You need to understand JMP row states. They are fundamental to controlling the behavior of JMP platforms. In this case, you need to change the Marker row state. The default marker state is a dot. You can interactively select all the rows, select Rows > Marker > "+", and then deselect all the rows. Row state changes are pushed out to all objects ("dynamic linking") so you do not have to change the row state before launching the platform.

 

There are data table messages to accomplish the same thing in a script:

 

Names Default to Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

biv = dt << Bivariate( Y( :weight ), X( :height ) );

Wait( 2 );

dt << Select All Rows << Markers( 1 ) << Clear Select;
Learn it once, use it forever!
Highlighted

Re: Change Row marker shape through JSL

If you would like to make the script more humanly-readable, you can also use names like Marker("Plus")

Highlighted
pmroz
Super User

Re: Change Row marker shape through JSL

You can also set the marker in the graph by right-clicking on the marker in the legend, and selecting Marker > +.  You need to do this for all the markers.  Then click the red triangle save the script somewhere.  It will look like this:

dt = New Table( "Untitled", Add Rows( 11 ),
	New Column( "X Value", Character, "Nominal",
		Set Values(
			{"02", "02", "02", "03", "03", "03", "04", "04", "05", "05", "05"}
		)
	),
	New Column( "Y Value", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [100, 120, 130, 110, 105, 108, 200, 220, 201, 190, 195] )
	)
);

dt << Graph Builder(
	Size( 528, 448 ),
	Show Control Panel( 0 ),
	Variables( X( :X Value ), Y( :Y Value ), Overlay( :X Value ) ),
	Elements( Points( X, Y, Legend( 14 ), Jitter( "None" ) ) ),
	SendToReport(
		Dispatch( {}, "400", ScaleBox,
			{Legend Model(
				14,
				Properties( 0, {Marker( "Plus" )}, Item ID( "02", 1 ) ),
				Properties( 1, {Marker( "Plus" )}, Item ID( "03", 1 ) ),
				Properties( 2, {Marker( "Plus" )}, Item ID( "04", 1 ) ),
				Properties( 3, {Marker( "Plus" )}, Item ID( "05", 1 ) ),
				Properties( -1, {Marker( "Plus" )}, Item ID( "Y Value", 1 ) )
			)}
		)
	)
);

View solution in original post

Highlighted
gzmorgan0
Super User

Re: Change Row marker shape through JSL

This is just an FYI, since the question was about changing markers by JSL. 

 

A frequent request is to set a special marker based upon another column's  row value or condition. The script below shows the markers  of the  extended ASCII character set and and two examples of special symbols, like a star or an infinity sign using the function

Hex to Number("hexcode")   . Run the script, there is a wait, then markers are changed for rows 4 and 5.

 

 

Names Default to Here(1);

Markers_dt = New Table( "Marker Codes",
	Add Rows( 301 ),
	New Column( "Marker Number", Numeric)
);
Markers_dt:Marker Number << Set Each Value(Row() -1);

For( i = 1, i <= N Row( Markers_dt ), i++,
	Marker Of( Row State( i ) ) = i-1;// Markers_dt:Marker Number[i]
);

wait(2);

Row State(4) = Combine States( 
     Selected State(1), Hidden State(1), 
	 Color State("Dark Blue Green"), 
	 Marker State( Hex to Number("221E") ) //Hex for unicode infinity
);
Markers_dt:Marker Number[4] = Hex to Number("221E");


Marker Of(Row State(5))= Hex to Number("2606"); //Hex for star
Markers_dt:Marker Number[5] = Hex to Number("2606");

 

Article Labels

    There are no labels assigned to this post.