Hi @Craige_Hales and @Craige_Hales and @txnelson
Right now, my script is working by your help. I would like to ask another question about scripting since I am really good at in scripting.
In my data table, I have two columns called "FORCEDROPTIME_3" and "ACTUAL_MAXCHASEHOLDFORCE_4"
I uses code below to draw convex hull around all data point
tri = Triangulation( X( :FORCEDROPTIME_3, :ACTUAL_MAXCHASEHOLDFORCE_4), Y( :ACTUALHEIGHTHOLDTIME_2 ) );// get contour around all data point
hulledge= tri << Get Hull Edges;
hullpoint =tri << Get Hull Points;
{xx, yy} = tri << Get Points();
tri2 = tri << Subset( tri << Get Hull Points ); // get data point of boundary
{tri2_xx, tri2_yy} = tri2 << Get Points();
Then I draw convex hull in the box and copy content frame to graph builder
New Window( "Contour Seg Example",
g = Graph Box(
X Scale( Min( xx ) - .1, Max( xx ) + .1 ),
Y Scale( Min( yy ) - .1, Max( yy ) + .1 ),
Contour Seg(
tri,
[0, 400, 1000, 2000, 9000],
zColor( 5 + [64 32 0 16 48] ),
Transparency( [1, 1, 1, 1, 1] )
),
Shape Seg( {Path( ashape << Get Hull Path() )}, <<Set Color( "Red" ) ),
Shape Seg( {Path( tri << Get Hull Path() )}, <<Set Color( "Black" ) )
)
);
frame = g[FrameBox( 1 )];
fontobj = seg = (frame << Find Seg( Contour Seg( 1 ) ));
frame << Copy Frame Contents;
//graphbuilder
chartdisplay = dt << Graph Builder(
Size( 1011, 666 ),
Show Control Panel( 0 ),
Variables( X( :FORCEDROPTIME_3 ), Y( :ACTUAL_MAXCHASEHOLDFORCE_4 ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) ),
SendToReport(
Dispatch(
{},
"FORCEDROPTIME_3",
ScaleBox,
{Min( Min( xx ) ), Max( Max( xx ) ), Inc( 100 ), Minor Ticks( 1 )}
),
Dispatch(
{},
"ACTUAL_MAXCHASEHOLDFORCE_4",
ScaleBox,
{Min( min(yy) ), Max( Max(yy) ), Inc( 2 ), Minor Ticks( 1 )}
)
)
);
rbiv1 = chartdisplay << report;
framebox2 = rbiv1[Frame Box( 1 )];
frame << Copy Frame Contents;
framebox2 << Paste Frame Contents;
The result is
I have 2 questions;
1. Is there anyway that I could draw convex hull directly into graph builder?
2. In the graph builder chart, if I would like to exclude or remove data data points, How I could get new convex hull constantly updated in the graph. For example, if I use local filter of graph builder to filter some data points
--> how could I get new convex hull according to filtered data points
--> how could I get X and Y matrix of new convex hull directly
Appreciate!