cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
] />

Discussions

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

change markers for selected points in a graph using JSL

I need to highlight some selected points on a plot. I can select them, but the selection does not show on saved plots, so as alternative, I want to change the markers of the selected points (i.e. rows). 

It's probably just one line, but can't figure out how to do that. Could somebody advise, please?

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

Graph Builder(
	Variables( X( :height ), Y( :weight )),
	Show Control Panel( 0 ),
);

dt << Select Where (:sex == "F");

//now I want to change the marker for the selected data
2 ACCEPTED SOLUTIONS

Accepted Solutions
mmarchandFSLR
Level VI

Re: change markers for selected points in a graph using JSL

You can send the <<Markers message to the data table when the rows you want are selected.

 

dt << Markers( "triangle" );

View solution in original post

hogi
Level XIII

Re: change markers for selected points in a graph using JSL

calculate a SIZE column from your selection (0/1) and use it as size in Graph Builder. Then you get different sizes for selected and non-selected points.

View solution in original post

6 REPLIES 6
mmarchandFSLR
Level VI

Re: change markers for selected points in a graph using JSL

You can send the <<Markers message to the data table when the rows you want are selected.

 

dt << Markers( "triangle" );
hogi
Level XIII

Re: change markers for selected points in a graph using JSL

You have to save the selection as 0/1  into a column *) - and use that column as Overlay.
In your case, you can directly use SEX as Overlay.


* in the video I used the shortcut key from the Quickselect Toolbar . As an alternative,you can Name Selection in Column from the Rows/Row Selection menu,

(view in My Videos)

hogi
Level XIII

Re: change markers for selected points in a graph using JSL

One major disadvantage of this approach is that: Overlay is often used for another purpose.
If you would like the option to use Overlay by multiple columns , please follow the wish and vote!

Another option:
Via right click - assign a Row State/Marker to the selected columns.

Unbenannt.png
The disadvantage of this approach: row states are static, they don't adapt interactively to the current data!

Re: change markers for selected points in a graph using JSL

Thanks @hogi, that's an interesting feature. Here though, I was looking for a JSL solution (which @mmarchandFSLR provided).

Re: change markers for selected points in a graph using JSL

@mmarchandFSLR 
Is there a similar way to change the size of the markers? Simply adding

Based on the example in the Scripting Index I tried a few approaches. The version below selects the right markers, but changes the size of all markers, not just the selected ones.

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

gb = Graph Builder(
	Variables( X( :height ), Y( :weight )),
	Show Control Panel( 0 ),
);

dt << Select Where (:sex == "F");
rbiv = gb << report;
//rbiv << Select Where (:sex == "F");
framebox = rbiv[Frame Box( 1 )];
//framebox << Select Where (:sex == "F");
framebox << Marker Size( 7 );
dt << Marker Size( 7 );
hogi
Level XIII

Re: change markers for selected points in a graph using JSL

calculate a SIZE column from your selection (0/1) and use it as size in Graph Builder. Then you get different sizes for selected and non-selected points.

Recommended Articles