Oh I see the issue now: hiding or excluding rows causes an index mismatch for the remaining data.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(Variables(X(:age), Y(:height)), Elements(Points(X, Y, Legend(3))));
dt << Select Rows([1, 10, 16, 20, 30]);
ms = Report(gb)[framebox(1)] << Find Seg(Marker Seg(1));
selrows = dt << Get Selected Rows();
pin_expr = {};
For Each({v}, selrows,
coord = ms << Get Point(v);
Show(coord);
Insert Into(
pin_expr,
Eval(
Eval Expr(
{Add Pin Annotation(
Seg( Marker Seg( 1 ) ),
Index Row( Expr( v - 1 ) ),
Origin( Expr(coord)),
UniqueID( Expr( v - 1 ) )
)}
)
)
)
);
Eval(
Substitute(
Expr( Report(gb)[framebox(1)] << __pin_expr__ ),
Expr( __pin_expr__ ), Name Expr( pin_expr )
)
);
By using this code, when row 17 hidden/excluded, it will cause the annotations of rows 20/30 to shift to the wrong positions.
Is there a way to prevent this from happening? I mean for sure I have data points to be excluded.