I apologise if this posts twice. My first post seems to have vanished.
Using Big Class as an example: plot height vs weight but only show correlation using Female data points.
Interactively:
- in the data table, select Male data rows and exclude (but NOT hide),
- in Graph Builder: plot height against weight, set sex as Overlay variable, change smoother to line of fit, then with the SHIFT key pressed select "Show Excluded Rows" from the red triangle menu (shift is needed to unhide this usually hidden option).
![matth1_0-1710847475354.png matth1_0-1710847475354.png](https://community.jmp.com/t5/image/serverpage/image-id/62341i3581C115E4287D0E/image-size/medium?v=v2&px=400)
Using scripting, with a local data filter this time instead of modifying the table:
Names Default to here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
dt << Graph Builder(
Size( 300, 200 ),
Show Control Panel( 0 ),
Show Excluded Rows( 1 ),
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements(
Points( X, Y, Legend( 3 ) ),
Line Of Fit( X, Y, Legend( 5 ), R²( 1 ) )
),
Local Data Filter(
Show Controls( 0 ),
Mode( Show( 0 ) ),
Add Filter( columns( :sex ), Where( :sex == "F" ) )
)
);
![matth1_1-1710847516624.png matth1_1-1710847516624.png](https://community.jmp.com/t5/image/serverpage/image-id/62342i924BC32F525A5C3E/image-size/medium?v=v2&px=400)
Hope this helps!