Triangulation
Example 1
Summary: Vizualizes triangulated data by generating a contour plot with specified levels and shape segments for hull paths.
Code:
dt = Open("data_table.jmp");
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
{xx, yy} = tri << Get Points();
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( tri << Get Hull Path() )}, <<Set Color( "Black" ) )
)
);
Code Explanation:
- Open data table;
- Perform triangulation on X, Y.
- Extract points from triangulation.
- Create new window named "Contour Seg Example".
- Initialize Graph Box.
- Set X scale with buffer.
- Set Y scale with buffer.
- Plot contour segments with specified levels.
- Apply color to contour segments.
- Add shape segments for hull path.
Example 2
Summary: Vizualizes triangulation data by generating a contour map with shape segments, utilizing the Triangulation and Graph Box platforms in JMP.
Code:
Open("data_table.jmp");
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
{xx, yy} = tri << Get Points();
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( tri << Get Hull Path() )}, <<Set Color( "Black" ) )
)
);
frame = g[FrameBox( 1 )];
seg = (frame << Find Seg( Contour Seg( 1 ) ));
Code Explanation:
- Open data table;
- Create triangulation object.
- Retrieve points from triangulation.
- Create new window.
- Initialize graph box.
- Set X scale.
- Set Y scale.
- Add contour segments.
- Add shape segments.
- Find contour segment.
Example 3
Summary: Creates a contour segment graph from triangulation data, utilizing X and Y scales, contour segments with custom colors and transparency, and shape segments for visual representation.
Code:
dt = Open("data_table.jmp");
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
{xx, yy} = tri << Get Points();
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( tri << Get Hull Path() )}, <<Set Color( "Black" ) )
)
);
frame = g[FrameBox( 1 )];
seg = (frame << Find Seg( Contour Seg( 1 ) ));
seg << Set Fill( "Fill Above" );
Code Explanation:
- Open data table;
- Create triangulation object.
- Retrieve triangulation points.
- Create new window for graph.
- Set X-axis scale.
- Set Y-axis scale.
- Add contour segments to graph.
- Add shape segments to graph.
- Find frame box in graph.
- Set contour segment fill mode.
Example 4
Summary: Creates a contour segment graph with shape segments, utilizing triangulation and point retrieval from a data table.
Code:
dt = Open("data_table.jmp");
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
{xx, yy} = tri << Get Points();
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( tri << Get Hull Path() )}, <<Set Color( "Black" ) )
)
);
frame = g[FrameBox( 1 )];
seg = (frame << Find Seg( Contour Seg( 1 ) ));
seg << Set Fill( "Lines" );
Code Explanation:
- Open data table;
- Create triangulation.
- Retrieve points from triangulation.
- Create new window.
- Initialize graph box.
- Set X scale.
- Set Y scale.
- Add contour segments.
- Add shape segments.
- Set contour fill mode.
Example 5
Summary: Vizualizes triangulation results by creating a contour segment graph with interactive fill mode.
Code:
dt = Open("data_table.jmp");
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
{xx, yy} = tri << Get Points();
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( tri << Get Hull Path() )}, <<Set Color( "Black" ) )
)
);
frame = g[FrameBox( 1 )];
seg = (frame << Find Seg( Contour Seg( 1 ) ));
seg << Set Fill( "Fill Below" );
Code Explanation:
- Open data table.
- Perform triangulation.
- Retrieve triangulation points.
- Create new window.
- Initialize graph box.
- Set X axis scale.
- Set Y axis scale.
- Add contour segments.
- Add shape segments.
- Set fill mode for contour segment.
Example 6
Summary: Creates a contour segment graph with specified levels and colors, utilizing triangulation points to visualize data.
Code:
dt = Open("data_table.jmp");
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
{xx, yy} = tri << Get Points();
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( tri << Get Hull Path() )}, <<Set Color( "Black" ) )
)
);
frame = g[FrameBox( 1 )];
seg = (frame << Find Seg( Contour Seg( 1 ) ));
seg << Set Fill( "Fill Between" );
Code Explanation:
- Open data_table data
- Create triangulation for X, Y, POP.
- Retrieve triangulation points.
- Create new window "Contour Seg Example".
- Initialize graph box.
- Set X scale with padding.
- Set Y scale with padding.
- Add contour segments with specified levels and colors.
- Add shape segment for hull path.
- Set contour fill to "Fill Between".
Example 7
Summary: Creates a contour segment graph with triangulation and shape segments, utilizing JMP's Graph Builder platform.
Code:
Open("data_table.jmp");
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
{xx, yy} = tri << Get Points();
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( tri << Get Hull Path() )}, <<Set Color( "Black" ) )
)
);
frame = g[FrameBox( 1 )];
seg = (frame << Find Seg( Contour Seg( 1 ) ));
seg << Set Fill( "Fill Below" );
str = seg << Get Fill;
str = Substr( str, 1, 5 );
Code Explanation:
- Open data table;
- Create triangulation object.
- Retrieve points from triangulation.
- Create new window for graph.
- Configure X and Y scales.
- Add contour segments to graph.
- Add shape segments to graph.
- Access first frame box.
- Find first contour segment.
- Set fill mode to below.
Example 8
Summary: Creates a contour segment graph with shape segments for hull paths, utilizing triangulation and point retrieval from a data table.
Code:
dt = Open("data_table.jmp");
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
{xx, yy} = tri << Get Points();
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( tri << Get Hull Path() )}, <<Set Color( "Black" ) )
)
);
frame = g[FrameBox( 1 )];
seg = (frame << Find Seg( Contour Seg( 1 ) ));
seg << Set Fill( "Fill Below" );
str = seg << Get Fill;
str = Substr( str, 1, 5 );
seg << Set Fill( (seg << Get Fill) || " Above" );
Code Explanation:
- Open data table;
- Create triangulation for X, Y, POP.
- Retrieve points from triangulation.
- New window "Contour Seg Example".
- Create graph box.
- Set X and Y scales.
- Add contour segments.
- Add shape segments for hull path.
- Find first frame box.
- Find first contour segment.
- Set fill to "Fill Below".
- Get fill string.
- Modify fill string.
- Set modified fill string.
Example 9
Summary: Vizualizes triangulated data by generating a contour plot with shape segments, utilizing the Triangulation and Contour Seg functions in JMP.
Code:
Open("data_table.jmp");
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
tri = tri << Peel;
{xx, yy} = tri << Get Points();
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( tri << Get Hull Path() )}, <<Set Color( "Black" ) )
)
);
frame = g[FrameBox( 1 )];
Code Explanation:
- Open data table;
- Perform triangulation on X, Y.
- Apply peel operation.
- Retrieve points from triangulation.
- Create new window for visualization.
- Set X scale for graph.
- Set Y scale for graph.
- Add contour segments to graph.
- Add shape segments to graph.
- Assign frame box to variable.
Example 10
Summary: Creates a contour segment map from a triangulation object, utilizing peel operation and point retrieval.
Code:
dt = Open("data_table.jmp");
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
tri = tri << Peel;
{xx, yy} = tri << Get Points();
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( tri << Get Hull Path() )}, <<Set Color( "Black" ) )
)
);
frame = g[FrameBox( 1 )];
seg = (frame << Find Seg( Contour Seg( 1 ) ));
Code Explanation:
- Open table.
- Create triangulation object.
- Perform peel operation.
- Retrieve points.
- Create new window.
- Set graph box properties.
- Add contour segments.
- Add shape segments.
- Access frame box.
- Find contour segment.