<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to make closewise continuous polygon with matrix in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/888181#M105047</link>
    <description>&lt;P&gt;maybe this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

New Window( "hull test",
	Data Filter Context Box( // from the scripting index: how to make a data filter. the 'f' is needed.
		H List Box(
			f = dt &amp;lt;&amp;lt; Data Filter( Local, Mode( Show( 1 ), Include( 1 ) ), Add Filter( columns( :age ) ) ),
			gb = dt &amp;lt;&amp;lt; Graph Builder(
				Size( 660, 491 ),
				Show Control Panel( 0 ),
				Variables( X( :weight ), Y( :height ) ),
				Elements( Points( X, Y, Legend( 5 ) ) ), 

			)
		)
	)
);

Report( gb )[framebox( 1 )] &amp;lt;&amp;lt; Add Graphics Script(
	// this script runs when the display needs to redraw.
	rows = f &amp;lt;&amp;lt; getfilteredrows; // get the currently chosen rows from the filter
	If( Is Empty( rows ),
		rows = 0; // handle the 'nothing selected' case; 0 means 'all rows'
	);
	x_matrix = dt[rows, {weight}];
	y_matrix = dt[rows, {height}];
	t = Triangulation( x( x_matrix, y_matrix ) ); // from the current rows
	{x_matrix, y_matrix} = t &amp;lt;&amp;lt; get points; // rearranged from input order!
	order = t &amp;lt;&amp;lt; gethullpoints;
	xs = x_matrix[order |/ order[1]]; // repeat 1st point to close the loop
	ys = y_matrix[order |/ order[1]];
	Line( xs, ys );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4587"&gt;@danschikore&lt;/a&gt;&amp;nbsp; - I think I made an error above when I didn't use &amp;lt;&amp;lt;getpoints with &amp;lt;&amp;lt;gethullpoints, even though it appeared to work. Using &amp;lt;&amp;lt;gethullpath makes it easier.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 20 Jul 2025 06:00:09 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2025-07-20T06:00:09Z</dc:date>
    <item>
      <title>How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887468#M104962</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;x_matrix = [59, 60, 62, 64, 68, 70, 80, 118, 130, 182, 461, 678, 696, 700, 701, 701, 701];&lt;BR /&gt;y_matrix = [44.07, -44.31, 105.11, -66.88, 132.65, -88.02, -91.87, -104.49, 116.54, -106.6, -108.17, -55.48, -95.9, -93, -87.98, -87.47, -69.45];&lt;BR /&gt;&lt;BR /&gt;I have matrix above. Is there any way to convert or sort them into continuous closewise polygon&lt;BR /&gt;&lt;BR /&gt;If my matrix x and y are not from convex polygon, is there any way to do so&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 14:11:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887468#M104962</guid>
      <dc:creator>PhamBao</dc:creator>
      <dc:date>2025-07-16T14:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887479#M104964</link>
      <description>&lt;P&gt;I am not exactly sure what is the context of your need for a polygon, however, if you look in the Scripting Index&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help=&amp;gt;Scripting Index&lt;/P&gt;
&lt;P&gt;and then search on Polygon, you will see the definition and example of using the Polygon function.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 14:39:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887479#M104964</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-07-16T14:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887567#M104969</link>
      <description>&lt;P&gt;this is close:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;x_matrix = [59, 60, 62, 64, 68, 70, 80, 118, 130, 182, 461, 678, 696, 700, 701, 701, 701];
y_matrix = [44.07, -44.31, 105.11, -66.88, 132.65, -88.02, -91.87, -104.49, 116.54, -106.6, -108.17, -55.48, -95.9, -93, -87.98, -87.47, -69.45];
t = Triangulation( x( x_matrix, y_matrix ) );
order = t &amp;lt;&amp;lt; gethullpoints;
xs = x_matrix[order];
ys = y_matrix[order];
dt = As Table( xs || ys );
Graph Builder(
	Size( 669, 491 ),
	Show Control Panel( 0 ),
	Variables( X( :Col1 ), Y( :Col2 ) ),
	Elements( Line( X, Y, Legend( 7 ), Ordering( "Row Order" ) ), Points( X, Y, Legend( 8 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Craige_Hales_0-1752695494108.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78390iD3848A224B6FB432/image-size/large?v=v2&amp;amp;px=999" role="button" title="Craige_Hales_0-1752695494108.png" alt="Craige_Hales_0-1752695494108.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Search the scripting index for "hull" and you'll find the&lt;A href="https://en.wikipedia.org/wiki/Alpha_shape" target="_self"&gt; alpha shape&lt;/A&gt; function as well. the Triangulation function can also tell you about points inside the hull and how they form a Delaunay triangulation. If you care about clockwise vs counter clockwise,&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-points-are-in-clockwise-order" target="_blank"&gt;https://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-points-are-in-clockwise-order&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm at the limit of my understanding, but I'd be fascinated to learn more about what you are doing.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4587"&gt;@danschikore&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 20:06:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887567#M104969</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-07-16T20:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887746#M104989</link>
      <description>&lt;P&gt;Thanks for the example&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;- alpha shapes are definitely interesting for cases like this, since&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/29644"&gt;@PhamBao&lt;/a&gt;&amp;nbsp;mentioned non-convex solutions.&amp;nbsp; When the input is a polygon, the results might not be quite what you expect.&amp;nbsp; The example below demonstrates the use of alpha shapes on a set of points.&amp;nbsp; The alpha shape is a subset of the Delaunay triangulation, which could include points, edges, and triangles.&amp;nbsp; In JMP, the alpha shape is showing you the only the triangles.&amp;nbsp; For alpha=0, you get the Delaunay triangulation and convex hull:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danschikore_0-1752758596250.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78448iE9BC04CAF2A1DFDF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="danschikore_0-1752758596250.png" alt="danschikore_0-1752758596250.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As you increase alpha, you can get a hole in the middle:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danschikore_1-1752758679465.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78451i272147DE7BFB3018/image-size/medium?v=v2&amp;amp;px=400" role="button" title="danschikore_1-1752758679465.png" alt="danschikore_1-1752758679465.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Increase further, and you can get shapes like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danschikore_2-1752758797292.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78453i577A82C5D8DDB9A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="danschikore_2-1752758797292.png" alt="danschikore_2-1752758797292.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But the output will not be a polygonal hull if the original samples do not include interior points.&amp;nbsp; I think this would require some additional post-processing to find the outer boundary polygon.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
x_matrix = [0.309016994374947, 0.470228201833979, 0.809016994374948, 0.760845213036123, 1, 0.760845213036123,
0.809016994374948, 0.470228201833979, 0.309016994374948, 0, -0.309016994374947, -0.470228201833978,
-0.809016994374948, -0.760845213036123, -1, -0.760845213036123, -0.809016994374948, -0.470228201833979,
-0.309016994374948, 0];
y_matrix = [0.951056516295153, 0.647213595499958, 0.587785252292473, 0.247213595499958, 0, -0.247213595499958,
-0.587785252292473, -0.647213595499958, -0.951056516295153, -0.8, -0.951056516295154, -0.647213595499958,
-0.587785252292473, -0.247213595499958, 0, 0.247213595499958, 0.587785252292473, 0.647213595499958,
0.951056516295153, 0.8];
t = Triangulation( x( x_matrix, y_matrix ) );
a = Alpha Shape( t );
a &amp;lt;&amp;lt; Set Alpha( alpha = 0 );
Eval(
	Eval Expr(
		New Window( "alpha shape",
			Outline Box( "Alpha Shape Explorer",
				HListBox(TextBox("Alpha: "), slider = Slider Box( 0, 4, alpha )),
				graph = Graph Box(
					Frame Size( 300, 300 ),
					X Scale( -1, 1 ),
					Y Scale( -1, 1 ),
					Path( Expr( a &amp;lt;&amp;lt; get hull path ) )
				)
			)
		)
	)
);
slider &amp;lt;&amp;lt; Set Function(
	Function( {this},
		a &amp;lt;&amp;lt; Set Alpha( alpha );
		Eval( Eval Expr( graph &amp;lt;&amp;lt; Set Graphics Script( Path( Expr( a &amp;lt;&amp;lt; Get Hull Path ) ) ) ) );
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jul 2025 13:31:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887746#M104989</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2025-07-17T13:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887808#M105002</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4587"&gt;@danschikore&lt;/a&gt;&amp;nbsp;Thanks! I found this picture and first three paragraphs useful for understanding alpha shape:&amp;nbsp;&lt;A href="https://doc.cgal.org/latest/Alpha_shapes_2/" target="_blank"&gt;https://doc.cgal.org/latest/Alpha_shapes_2/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here it is with some random points.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;n=200;
x_matrix = j(n,1,randomuniform(-1,1));
y_matrix = j(n,1,randomuniform(-1,1));
t = Triangulation( x( x_matrix, y_matrix ) );
a = Alpha Shape( t );
a &amp;lt;&amp;lt; Set Alpha( alpha = 0 );
Eval(
	Eval Expr(
		New Window( "alpha shape",
			Outline Box( "Alpha Shape Explorer",
				HListBox(TextBox("Alpha: "), slider = Slider Box( 0, 10, alpha )),
				graph = Graph Box(
					Frame Size( 300, 300 ),
					X Scale( -1, 1 ),
					Y Scale( -1, 1 ),
					Path( Expr( a &amp;lt;&amp;lt; get hull path ) );
					marker(x_matrix,y_matrix)
				)
			)
		)
	)
);
slider &amp;lt;&amp;lt; Set Function(
	Function( {this},
		a &amp;lt;&amp;lt; Set Alpha( alpha );
		Eval( Eval Expr( graph &amp;lt;&amp;lt; Set Graphics Script( Path( Expr( a &amp;lt;&amp;lt; Get Hull Path ) );marker(x_matrix,y_matrix) ) ) );
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6375764628112w552h540r275" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6375764628112" data-account="6058004218001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6058004218001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6375764628112w552h540r275');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.jmp.com/t5/video/gallerypage/video-id/6375764628112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 18:03:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887808#M105002</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-07-17T18:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887836#M105004</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4587"&gt;@danschikore&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;: appreciate all for your response and suggestion. All suggestions works for me&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 20:02:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887836#M105004</guid>
      <dc:creator>PhamBao</dc:creator>
      <dc:date>2025-07-17T20:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887850#M105006</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Right now, my script is working by your help.&amp;nbsp; I would like to ask another question about scripting since I am really good at in scripting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my data table, I have two columns called "FORCEDROPTIME_3" and "ACTUAL_MAXCHASEHOLDFORCE_4"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I uses code below to draw&amp;nbsp; convex hull around all data point&lt;/P&gt;
&lt;P&gt;tri = Triangulation( X( :FORCEDROPTIME_3, :ACTUAL_MAXCHASEHOLDFORCE_4), Y( :ACTUALHEIGHTHOLDTIME_2 ) );// get contour around all data point&lt;BR /&gt;hulledge= tri &amp;lt;&amp;lt; Get Hull Edges;&lt;BR /&gt;hullpoint =tri &amp;lt;&amp;lt; Get Hull Points;&lt;BR /&gt;{xx, yy} = tri &amp;lt;&amp;lt; Get Points();&lt;BR /&gt;tri2 = tri &amp;lt;&amp;lt; Subset( tri &amp;lt;&amp;lt; Get Hull Points ); // get data point of boundary&lt;BR /&gt;{tri2_xx, tri2_yy} = tri2 &amp;lt;&amp;lt; Get Points();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I draw convex hull in the box and copy content frame to graph builder&lt;/P&gt;
&lt;DIV&gt;New Window( "Contour Seg Example",&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; g = Graph Box(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; X Scale( Min( xx ) - .1, Max( xx ) + .1 ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Y Scale( Min( yy ) - .1, Max( yy ) + .1 ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Contour Seg(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; tri,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; [0, 400, 1000, 2000, 9000],&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; zColor( 5 + [64 32 0 16 48] ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Transparency( [1, 1, 1, 1, 1] )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Shape Seg( {Path( ashape &amp;lt;&amp;lt; Get Hull Path() )}, &amp;lt;&amp;lt;Set Color( "Red" ) ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Shape Seg( {Path( tri &amp;lt;&amp;lt; Get Hull Path() )}, &amp;lt;&amp;lt;Set Color( "Black" ) )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;);&lt;/DIV&gt;
&lt;DIV&gt;frame = g[FrameBox( 1 )];&lt;/DIV&gt;
&lt;DIV&gt;fontobj = seg = (frame &amp;lt;&amp;lt; Find Seg( Contour Seg( 1 ) ));&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;frame &amp;lt;&amp;lt; Copy Frame Contents;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;//graphbuilder&lt;/DIV&gt;
&lt;DIV&gt;chartdisplay = dt &amp;lt;&amp;lt; Graph Builder(&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Size( 1011, 666 ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Show Control Panel( 0 ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Variables( X( :FORCEDROPTIME_3 ), Y( :ACTUAL_MAXCHASEHOLDFORCE_4 ) ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; SendToReport(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Dispatch(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; {},&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "FORCEDROPTIME_3",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; ScaleBox,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; {Min( Min( xx ) ), Max( Max( xx ) ), Inc( 100 ), Minor Ticks( 1 )}&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Dispatch(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; {},&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "ACTUAL_MAXCHASEHOLDFORCE_4",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; ScaleBox,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; {Min( min(yy) ), Max( Max(yy) ), Inc( 2 ), Minor Ticks( 1 )}&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;);&lt;/DIV&gt;
&lt;DIV&gt;rbiv1 = chartdisplay &amp;lt;&amp;lt; report;&lt;/DIV&gt;
&lt;DIV&gt;framebox2 = rbiv1[Frame Box( 1 )];&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;frame &amp;lt;&amp;lt; Copy Frame Contents;&lt;/DIV&gt;
&lt;DIV&gt;framebox2 &amp;lt;&amp;lt; Paste Frame Contents;&lt;BR /&gt;&lt;BR /&gt;The result is&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PhamBao_0-1752783496279.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78489i037F5F3EFBBFDBC6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PhamBao_0-1752783496279.png" alt="PhamBao_0-1752783496279.png" /&gt;&lt;/span&gt;
&lt;P&gt;I have 2 questions;&lt;BR /&gt;1. Is there anyway that I could draw convex hull directly into graph builder?&lt;BR /&gt;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&lt;/P&gt;
&lt;P&gt;--&amp;gt; how could I get new convex hull according to filtered data points&amp;nbsp;&lt;BR /&gt;--&amp;gt; how could I get X and Y matrix of new convex hull directly&lt;BR /&gt;&lt;BR /&gt;Appreciate!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Jul 2025 20:28:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/887850#M105006</guid>
      <dc:creator>PhamBao</dc:creator>
      <dc:date>2025-07-17T20:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/888112#M105031</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4587"&gt;@danschikore&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Based on your suggestion, it works for me. I also would like to ask some questions whether I could make script become more interactive. Since I am not really good at scripting, I would like to clarify what I want and hopefully I could get inputs and help from you guys&lt;BR /&gt;In my data table, I have 2 columns named "A" and "B" and then I use Triangulation to get convex hull of data points&lt;/P&gt;
&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;Triangulation&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;After getting convex hull, I draw polygon in box and copy frame content to graph builder&lt;BR /&gt;&lt;BR /&gt;1. Is there any way that I could get convent hull and draw it directly in graph builder&lt;BR /&gt;2. If I would like to exclude some data points, how I could get instant convex hull updated in graph builder as well as to get new convex hull data points&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PhamBao_0-1752904016674.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78569iEAD4427DC7C21686/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PhamBao_0-1752904016674.png" alt="PhamBao_0-1752904016674.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PhamBao_1-1752904047810.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78570i8703C13D639033B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PhamBao_1-1752904047810.png" alt="PhamBao_1-1752904047810.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is my script:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;dt= Open( "ww17_DATAALL.CSV");&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;tri = Triangulation( X( :A, :B), Y( :C ) );&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;// get contour around all data point&lt;/DIV&gt;
&lt;DIV&gt;hulledge= tri &amp;lt;&amp;lt; Get Hull Edges;&lt;/DIV&gt;
&lt;DIV&gt;hullpoint =tri &amp;lt;&amp;lt; Get Hull Points;&lt;/DIV&gt;
&lt;DIV&gt;{xx, yy} = tri &amp;lt;&amp;lt; Get Points();&lt;/DIV&gt;
&lt;DIV&gt;tri2 = tri &amp;lt;&amp;lt; Subset( tri &amp;lt;&amp;lt; Get Hull Points ); // get data point of boundary&lt;/DIV&gt;
&lt;DIV&gt;{tri2_xx, tri2_yy} = tri2 &amp;lt;&amp;lt; Get Points();&lt;/DIV&gt;
&lt;DIV&gt;show(tri2_xx);&lt;/DIV&gt;
&lt;DIV&gt;show(tri2_yy);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;//&lt;/DIV&gt;
&lt;DIV&gt;ashape = Alpha Shape(tri);&lt;/DIV&gt;
&lt;DIV&gt;ashape &amp;lt;&amp;lt; Set Alpha(0.01);&lt;/DIV&gt;
&lt;DIV&gt;{ax, ay} = ashape &amp;lt;&amp;lt; Get Points();&lt;/DIV&gt;
&lt;DIV&gt;atri = ashape &amp;lt;&amp;lt; Get Triangles;&lt;/DIV&gt;
&lt;DIV&gt;ashape2 = ashape&amp;lt;&amp;lt; Subset( ashape&amp;lt;&amp;lt; Get Hull Points ); // get data point of boundary&lt;/DIV&gt;
&lt;DIV&gt;{ashape2_xx, ashape2_yy} = ashape2 &amp;lt;&amp;lt; Get Points();&lt;/DIV&gt;
&lt;DIV&gt;show(ashape2_xx);&lt;/DIV&gt;
&lt;DIV&gt;show(ashape2_yy);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;New Window( "Contour Seg Example",&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; g = Graph Box(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; X Scale( Min( xx ) - .1, Max( xx ) + .1 ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Y Scale( Min( yy ) - .1, Max( yy ) + .1 ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Contour Seg(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; tri,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; [0, 400, 1000, 2000, 9000],&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; zColor( 5 + [64 32 0 16 48] ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Transparency( [1, 1, 1, 1, 1] )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Shape Seg( {Path( ashape &amp;lt;&amp;lt; Get Hull Path() )}, &amp;lt;&amp;lt;Set Color( "Red" ) ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Shape Seg( {Path( tri &amp;lt;&amp;lt; Get Hull Path() )}, &amp;lt;&amp;lt;Set Color( "Black" ) )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;);&lt;/DIV&gt;
&lt;DIV&gt;frame = g[FrameBox( 1 )];&lt;/DIV&gt;
&lt;DIV&gt;fontobj = seg = (frame &amp;lt;&amp;lt; Find Seg( Contour Seg( 1 ) ));&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;frame &amp;lt;&amp;lt; Copy Frame Contents;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;//graphbuilder&lt;/DIV&gt;
&lt;DIV&gt;chartdisplay = dt &amp;lt;&amp;lt; Graph Builder(&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Size( 1011, 666 ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Show Control Panel( 0 ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Variables( X( :A ), Y( :B ) ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; SendToReport(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Dispatch(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; {},&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "A",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; ScaleBox,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; {Min( Min( xx ) ), Max( Max( xx ) ), Inc( 100 ), Minor Ticks( 1 )}&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; Dispatch(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; {},&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; "B",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; ScaleBox,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; {Min( min(yy) ), Max( Max(yy) ), Inc( 2 ), Minor Ticks( 1 )}&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;);&lt;/DIV&gt;
&lt;DIV&gt;rbiv1 = chartdisplay &amp;lt;&amp;lt; report;&lt;/DIV&gt;
&lt;DIV&gt;framebox2 = rbiv1[Frame Box( 1 )];&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;frame &amp;lt;&amp;lt; Copy Frame Contents;&lt;/DIV&gt;
&lt;DIV&gt;framebox2 &amp;lt;&amp;lt; Paste Frame Contents;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 19 Jul 2025 05:48:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/888112#M105031</guid>
      <dc:creator>PhamBao</dc:creator>
      <dc:date>2025-07-19T05:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/888171#M105044</link>
      <description>&lt;P&gt;sorry, the spam trap is aggressive today! I released both.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jul 2025 03:07:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/888171#M105044</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-07-20T03:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/888181#M105047</link>
      <description>&lt;P&gt;maybe this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

New Window( "hull test",
	Data Filter Context Box( // from the scripting index: how to make a data filter. the 'f' is needed.
		H List Box(
			f = dt &amp;lt;&amp;lt; Data Filter( Local, Mode( Show( 1 ), Include( 1 ) ), Add Filter( columns( :age ) ) ),
			gb = dt &amp;lt;&amp;lt; Graph Builder(
				Size( 660, 491 ),
				Show Control Panel( 0 ),
				Variables( X( :weight ), Y( :height ) ),
				Elements( Points( X, Y, Legend( 5 ) ) ), 

			)
		)
	)
);

Report( gb )[framebox( 1 )] &amp;lt;&amp;lt; Add Graphics Script(
	// this script runs when the display needs to redraw.
	rows = f &amp;lt;&amp;lt; getfilteredrows; // get the currently chosen rows from the filter
	If( Is Empty( rows ),
		rows = 0; // handle the 'nothing selected' case; 0 means 'all rows'
	);
	x_matrix = dt[rows, {weight}];
	y_matrix = dt[rows, {height}];
	t = Triangulation( x( x_matrix, y_matrix ) ); // from the current rows
	{x_matrix, y_matrix} = t &amp;lt;&amp;lt; get points; // rearranged from input order!
	order = t &amp;lt;&amp;lt; gethullpoints;
	xs = x_matrix[order |/ order[1]]; // repeat 1st point to close the loop
	ys = y_matrix[order |/ order[1]];
	Line( xs, ys );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4587"&gt;@danschikore&lt;/a&gt;&amp;nbsp; - I think I made an error above when I didn't use &amp;lt;&amp;lt;getpoints with &amp;lt;&amp;lt;gethullpoints, even though it appeared to work. Using &amp;lt;&amp;lt;gethullpath makes it easier.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jul 2025 06:00:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/888181#M105047</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-07-20T06:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/888354#M105063</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank for your help. It works&lt;BR /&gt;&lt;BR /&gt;I try to edit the code a little bit, but it does work. Is there anyway that I could add slider into&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;Add Graphics Script&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so that I could get value from slider as variable&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2025 14:47:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/888354#M105063</guid>
      <dc:creator>PhamBao</dc:creator>
      <dc:date>2025-07-21T14:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/888356#M105064</link>
      <description>I think the script in our other thread does exactly that. &lt;BR /&gt;A slider box doesn't go *in* the graphics script. It is a display box that is in the new window. The variable that the slider box sets can be referenced in the script.</description>
      <pubDate>Mon, 21 Jul 2025 15:09:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/888356#M105064</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-07-21T15:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/889279#M105137</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;If I get points&amp;nbsp; ashape2_xx,ashape2_yy from&amp;nbsp;&lt;CODE class=" language-jsl"&gt;ashape2 = ashape&amp;lt;&amp;lt; Subset( ashape&amp;lt;&amp;lt; Get Hull Points ); // get data point of boundary
{ashape2_xx, ashape2_yy} = ashape2 &amp;lt;&amp;lt; Get Points(),&amp;nbsp;then&amp;nbsp;I&amp;nbsp;use&amp;nbsp;polygon(ahsape2_xx, ashape2_yy)&amp;nbsp;instead&amp;nbsp;of&amp;nbsp;Path(),&amp;nbsp;polygon&amp;nbsp;is&amp;nbsp;not&amp;nbsp;continuous&lt;BR /&gt;Do you know how I could sort ashape2_xx anshape2_yy, so that I could draw continuous polygon from Polygon() syntax&lt;BR /&gt;&lt;BR /&gt;Thank a lot,&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ashape = Alpha Shape(tri);
ashape &amp;lt;&amp;lt; Set Alpha(0.01);
{ax, ay} = ashape &amp;lt;&amp;lt; Get Points();
atri = ashape &amp;lt;&amp;lt; Get Triangles;
ashape2 = ashape&amp;lt;&amp;lt; Subset( ashape&amp;lt;&amp;lt; Get Hull Points ); // get data point of boundary
{ashape2_xx, ashape2_yy} = ashape2 &amp;lt;&amp;lt; Get Points();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2025 01:49:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/889279#M105137</guid>
      <dc:creator>PhamBao</dc:creator>
      <dc:date>2025-07-25T01:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/889622#M105168</link>
      <description>&lt;P&gt;It might be worth backing up and describing what you need to do (perhaps in a new question).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've played with alpha shape for a while and think I understand what you are fighting with:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both the &amp;lt;&amp;lt;get hull path and &amp;lt;&amp;lt;get hull points return a bunch of segments in scrambled order. Path covers up the problem by drawing all the segments using a move/draw for each; this makes 1 or more visual polygons, but not with a sequential border that works for filling a polygon. The points version returns the same data (as indexes into the &amp;lt;&amp;lt;getpoints data), and it can be used just like the path version...but again, not for filling.&lt;/P&gt;
&lt;P&gt;If there is only a single outline for one polygon, it isn't too hard to sort the segments into a nice loop. If there are multiple polygons that don't share vertices, it is only a little harder. But if there are shared points between polygons the problem seems quite hard. If you turn the alpha up much, there will often be multiple polygons sharing points.&lt;/P&gt;
&lt;P&gt;If you want to experiment with sorting the polygon edges into a loop, consider using a JSL list to hold the indexes. You can put the first edge in the list something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;plist = {};
ie = 1; // index to an edge
from = hullEdges[ie, 1];
dest = hullEdges[ie, 2];
Insert Into( plist, from ); // append to empty list
Insert Into( plist, dest );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you can then walk through the hulledge matrix looking for edges that connect at the beginning or end of plist:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;					found = 1;
					While( found,
						found = 0;
						For( je = 1, je &amp;lt;= ne, je += 1,
							testfrom = hullEdges[je, 1];
							testdest = hullEdges[je, 2];
								If(
									from == testdest, 
										// add to left end
										Insert Into( plist, testfrom, 1 );
										from = testfrom;
										pointCounts[testfrom] -= 1;
										pointCounts[testdest] -= 1;
										found = 1;//
								, /*else */ dest == testfrom, //
										// add to right end
										Insert Into( plist, testdest );
										dest = testdest;
										pointCounts[testfrom] -= 1;
										pointCounts[testdest] -= 1;
										found = 1;
								);
							);
						);
					);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you successfully collect the indexes to the points, you can make a polygon, something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// {x2, y2} = ashape2 &amp;lt;&amp;lt; getPoints;
					// gather the polygon x and y matrices
					idx = plist;
					xdata = x2[idx];
					ydata = y2[idx];
					Transparency( .2 );
					Fill Color( HLS Color( (ie + 1) / ne, .5, 1 ) );
					Polygon( xdata, ydata, &amp;lt;&amp;lt;fill( 1 ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you might want something like this to check if there are points used by more than two edges:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;			np = ashape2 &amp;lt;&amp;lt; getnpoints;
			// most points are in 2 segs. some are in 4 segs.
			pointCounts = J( np, 1, 0 );
			If( N Rows( hullEdges ) &amp;gt; 0,pointCounts[hullEdges]++);
			
			If( !All( pointCounts == 2 ),
				Print( "too complicated" )
			);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That middle statement uses a 2-d matrix to index a matrix of counts and increment the counts 0, 2, or 4 times.&lt;/P&gt;
&lt;P&gt;if you have multiple polygons, you might need to keep up with which points have been used already and wrap another JSL loop around your code to find a new starting point.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jul 2025 03:07:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/889622#M105168</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-07-27T03:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/892067#M105303</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;Thank your instruction. I try to follow your instruction to create my code. Since I'm not good at coding, what is&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;pointCounts&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Could you give me a full code?&amp;nbsp;&lt;BR /&gt;Sincerely&lt;/P&gt;</description>
      <pubDate>Sun, 03 Aug 2025 04:10:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/892067#M105303</guid>
      <dc:creator>PhamBao</dc:creator>
      <dc:date>2025-08-03T04:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/892074#M105304</link>
      <description>The "J" function creates a matrix, so&lt;BR /&gt;pointCounts = J( np, 1, 0 );&lt;BR /&gt;Makes a np rows by 1 col matrix initialized to 0.&lt;BR /&gt;The next statement, &lt;BR /&gt;If( N Rows( hullEdges ) &amp;gt; 0,&lt;BR /&gt;        pointCounts[hullEdges]++)&lt;BR /&gt;Checks if there are any edges in hulledges (also a matrix with 2 cols for the from and to vertices). If so, every point index in hulledges is used as an index into pointcounts. Most points occur twice (connecting two edges ), resulting in a count of 2. Some occur 4 if two polys touch at that point. Some occur 0 times in hulledges if they are not in a poly with edges.&lt;BR /&gt;You'll need to write and maintain this code; this community, the scripting index in the help menu, and the jsl scripting guide are great resources for the low level parts.</description>
      <pubDate>Sun, 03 Aug 2025 11:58:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/892074#M105304</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-08-03T11:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/892085#M105306</link>
      <description>&lt;P&gt;You don't have to use the pointcounts at all if you know there is exactly one polygon. You can comment out those statements to get started.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When your data makes multiple polygons that touch, you might want to know. The pointcounts will help you write the code to handle that case.&lt;/P&gt;
&lt;P&gt;The 4th block of code should be first to set up the total counts if you need them.&lt;/P&gt;
&lt;P&gt;The 2nd block is an example of using the counts by decrementing them after they are used. You might do that to&amp;nbsp; help figure out which points are still not used up when ordering the edges of the polygons.&lt;/P&gt;
&lt;P&gt;In the video, way above, you can see a frame with islands and holes. I've colored it by hand, maybe correctly. Blue is "in", tan is "out". The hard part will be dealing with polygons like 1 and 2.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Craige_Hales_1-1754260256546.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/79547i9F8316E36E7B7827/image-size/large?v=v2&amp;amp;px=999" role="button" title="Craige_Hales_1-1754260256546.png" alt="Craige_Hales_1-1754260256546.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you never push the alpha parameter far enough to make islands and holes, then you only have a single continuous outline and the code above should sort it so it works with the polygon command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Aug 2025 22:36:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/892085#M105306</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-08-03T22:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/892568#M105360</link>
      <description>&lt;P&gt;Hi Craige_Hales,&lt;BR /&gt;I try to use your code as reference and apply it into my own&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;

dt= Open( "C:\Users\lamquocb\OneDrive - Intel Corporation\Desktop\Python Script\Regression\RPLP682\trial.jmp");



//
tri = Triangulation( X( :FORCEDROPTIME_3, :ACTUAL_MAXCHASEHOLDFORCE_4), Y( :ACTUALHEIGHTHOLDTIME_2 ) );


// get contour around all data point
hulledge= tri &amp;lt;&amp;lt; Get Hull Edges;
hullpoint =tri &amp;lt;&amp;lt; Get Hull Points;
{xx, yy} = tri &amp;lt;&amp;lt; Get Points();
tri2 = tri &amp;lt;&amp;lt; Subset( tri &amp;lt;&amp;lt; Get Hull Points ); // get data point of boundary
{tri2_xx, tri2_yy} = tri2 &amp;lt;&amp;lt; Get Points();

////////////

ashape = Alpha Shape(tri);
ashape &amp;lt;&amp;lt; Set Alpha(0.01);
{ax, ay} = ashape &amp;lt;&amp;lt; Get Points();
atri = ashape &amp;lt;&amp;lt; Get Triangles;
ashape2 = ashape&amp;lt;&amp;lt; Subset( ashape&amp;lt;&amp;lt; Get Hull Points ); // get data point of boundary
{ashape2_xx, ashape2_yy} = ashape2 &amp;lt;&amp;lt; Get Points();


hullEdges=ashape &amp;lt;&amp;lt; Get Hull Edges;
plist = {};
ie = 1; // index to an edge
from = hullEdges[ie, 1];
dest = hullEdges[ie, 2];
Insert Into( plist, from ); // append to empty list
Insert Into( plist, dest );
found = 1;
					While( found,
						found = 0;
						For( je = 1, je &amp;lt;= N Items(hullEdges), je += 1,
							testfrom = hullEdges[je, 1];
							testdest = hullEdges[je, 2];
								If(
									from == testdest, 
										// add to left end
										Insert Into( plist, testfrom, 1 );
										from = testfrom;
										
										found = 1;//
								, /*else */ dest == testfrom, //
										// add to right end
										Insert Into( plist, testdest );
										dest = testdest;
									
										found = 1;
								);
							);
						);
					&lt;/CODE&gt;&lt;/PRE&gt;
However I got the error :&amp;nbsp;&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;invalid subscript (must be number or list of numbers) in access or evaluation of 'hullEdges[ /*###*/je,1]' , hullEdges[/*###*/je, 1]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;Typically if I actual number into hullEdge[1,2] as an example instead of hullEdges[je, 2], I got the result returns&lt;BR /&gt;&lt;BR /&gt;Do you have any idea to resolve the issue?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Aug 2025 00:57:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/892568#M105360</guid>
      <dc:creator>PhamBao</dc:creator>
      <dc:date>2025-08-06T00:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to make closewise continuous polygon with matrix</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/892584#M105362</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/1893"&gt;@Audrey_Shull&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;JMP's error message makes the problem hard to understand. it should say&lt;/P&gt;
&lt;P&gt;"the first index to hulledges[ 33, 2 ] is 34 and out of bounds"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;nitems returns the total number of elements, not the number of rows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;change&lt;/P&gt;
&lt;LI-CODE lang="jsl"&gt;For( je = 1, je &amp;lt;= N Items(hullEdges), je += 1,&lt;/LI-CODE&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;For( je = 1, je &amp;lt;= N Rows(hullEdges), je += 1,&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 02:21:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-closewise-continuous-polygon-with-matrix/m-p/892584#M105362</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-08-06T02:21:59Z</dc:date>
    </item>
  </channel>
</rss>

