Ternary Plot
Example 1
Summary: Visualizes a ternary plot to analyze the relationships between CuSO4, Na2S2O3, and Glyoxal using a predefined data table.
Code:
// Ternary Plot
// Open data table
dt = Open("data_table.jmp");
// Ternary Plot
obj =
Ternary Plot(
Y( :CuSO4, :Na2S2O3, :Glyoxal )
);
Report( obj )[framebox( 1 )] <<
Marker Size( 4 );
Code Explanation:
- Open data table.
- Create ternary plot object.
- Set Y variables.
- Access report object.
- Modify marker size.
Example 2
Summary: Visualizes a ternary plot to compare the proportions of Propanol, Butanol, and Pentanol using a predefined data table.
Code:
// Ternary Plot
// Open data table
dt = Open("data_table.jmp");
// Ternary Plot
Ternary Plot(
X( :Propanol, :Butanol, :Pentanol ),
SendToReport(
Dispatch( {}, "Ternary Plot",
FrameBox,
{Marker Size( 6 ),
Marker Drawing Mode(
"Normal"
)}
)
)
);
Code Explanation:
- Open data table.
- Create ternary plot.
- Set X variables.
- Send report settings.
- Configure marker size.
- Set marker drawing mode.
Example 3
Summary: Visualizes a ternary plot to analyze the relationships between Screech, Whine, and Roar variables from a predefined data table.
Code:
// Ternary Plot
// Open data table
dt = Open("data_table.jmp");
// Ternary Plot
Ternary Plot(
Y( :Screech, :Whine, :Roar )
);
Code Explanation:
- Open table.
- Create ternary plot.
- Set Y variables.
Example 4
Summary: Visualizes a ternary plot from a predefined data table, utilizing the Ternary Plot function to display the relationships between three variables.
Code:
// Ternary Plot
// Open data table
dt = Open("data_table.jmp");
// Ternary Plot
Ternary Plot( Y( :p1, :p2, :p3 ) );
Code Explanation:
- Open data table.
- Create ternary plot.
- Set Y variables.
Example 5
Summary: Visualizes a ternary plot from a predefined data table, setting marker size to 4.
Code:
// Ternary Plot
// Open data table
dt = Open("data_table.jmp");
// Ternary Plot
obj = Ternary Plot( Y( :p1, :p2, :p3 ) );
Report( obj )[framebox( 1 )] <<
Marker Size( 4 );
Code Explanation:
- Open data table.
- Create ternary plot.
- Set marker size.
Example 6
Summary: Visualizes a ternary plot from a predefined data table, utilizing Y variables to represent the relationships between three categorical variables.
Code:
// Ternary Plot
// Open data table
dt = Open("data_table.jmp");
// Ternary Plot
Ternary Plot( Y( :Yat, :Yee, :Sam ) );
Code Explanation:
- Open data table.
- Create ternary plot.
- Set Y variables.
Example 7
Summary: Creates a ternary plot with customizable background color, frame size, and marker size, and captures its picture for further manipulation in a new window.
Code:
Open("data_table.jmp");
tp = Ternary Plot(
Y( :p1, :p2, :p3 ),
SendToReport(
Dispatch( {}, "Ternary Plot", OutlineBox, {Background Color( 72 ), Set Title( "Ternary Plot: axes/background color (GCanvas)" )} ),
Dispatch( {}, "Ternary Plot", FrameBox, {Frame Size( 480, 415 ), Background Color( 76 ), Marker Size( 4 )} )
)
);
fb = Report( tp )[Picture Box( 1 )];
New Window( "test",
Lineup Box( N Col( 3 ),
Tab Page Box( "transparent scalable", fb << Get Picture( Transparent Background( 1 ) ) ),
Tab Page Box( "opaque scalable", fb << Get Picture( Transparent Background( 0 ) ) ),
Tab Page Box( "opaque scalable scaled", fb << Get Picture( Transparent Background( 0 ), Scale( 1.1 ) ) ),
Tab Page Box( "transparent bitmap", fb << Get Picture( Transparent Background( 1 ), Type( "Bitmap" ) ) ),
Tab Page Box( "opaque bitmap", fb << Get Picture( Transparent Background( 0 ), Type( "Bitmap" ) ) ),
Tab Page Box( "opaque bitmap scaled", fb << Get Picture( Transparent Background( 0 ), Type( "Bitmap" ), Scale( 1.1 ) ) )
)
);
Code Explanation:
- Open data table;
- Create ternary plot.
- Set background color.
- Set plot title.
- Adjust frame size.
- Change frame background.
- Set marker size.
- Capture plot picture.
- Create new window.
- Add tab pages with different picture settings.
Example 8
Summary: Creates a ternary plot from a predefined data table, utilizing custom formatting and random resets for interactive visualization.
Code:
dt = Open("data_table.jmp");
Ternary Plot(
Y( :Yat, :Yee, :Sam ),
SendToReport(
Dispatch( {}, "1", ScaleBox,
{Format(
"Custom",
Formula(
Random Reset( 6 );
value > Random Uniform();
),
9
)}
),
Dispatch( {}, "2", ScaleBox,
{Format(
"Custom",
Formula(
Random Reset( 3 );
Random Integer( value * 10 );
),
9
)}
),
Dispatch( {}, "3", ScaleBox, {Format( "Custom", Formula( Round( Trigamma( value ), 2 ) ), 9 )} )
)
);
Code Explanation:
- Open data table.
- Create ternary plot.
- Set Y variables.
- Customize first scale box.
- Apply random reset.
- Compare value to random uniform.
- Customize second scale box.
- Reset random seed.
- Generate random integer.
- Customize third scale box.
Example 9
Summary: Creates a ternary plot from a predefined data table, visualizing the relationships between three variables (p1, p2, and p3).
Code:
dt = Open("data_table.jmp");
obj = Ternary Plot( Y( :p1, :p2, :p3 ) );
Code Explanation:
- Open data table.
- Create ternary plot object.
- Set plot variables.
Example 10
Summary: Creates a Ternary Plot from a predefined data table, customizing report background and frame settings.
Code:
Open("data_table.jmp");
Ternary Plot(
Y( :p1, :p2, :p3 ),
SendToReport(
Dispatch( {}, "Ternary Plot", OutlineBox, {Background Color( 72 ), Set Title( "Ternary Plot: axies/background color (GCanvas)" )} ),
Dispatch( {}, "Ternary Plot", FrameBox, {Frame Size( 480, 415 ), Background Color( 76 ), Marker Size( 4 )} )
)
);
Code Explanation:
- Open data_table data
- Create ternary plot.
- Set Y variables.
- Customize report background.
- Set plot title.
- Adjust frame size.
- Change frame background.
- Modify marker size.
Example 11
Summary: Creates a CUSUM control chart for quality control monitoring using a predefined data table.
Code:
dt = Open("data_table.jmp");
obj = Ternary Plot( Y( :p1, :p2, :p3 ), Contour Formula( :Pred Formula Y ) );
Code Explanation:
- Open data table;
- Create ternary plot object.
- Set Y variables.
- Define contour formula.
Example 12
Summary: Creates a ternary plot for quality control monitoring using a predefined data table, filtering by column p3.
Code:
Open("data_table.jmp");
Ternary Plot( Y( :p1, :p2, :p3 ), Local Data Filter( Add Filter( columns( :p3 ) ) ), );
Code Explanation:
- Open data_table data
- Create ternary plot.
- Set Y variables: p1, p2, p3.
- Add local data filter.
- Filter by column p3.
Example 13
Summary: Creates a ternary plot with local data filtering for quality control monitoring, utilizing predefined data and custom table definition.
Code:
Open("data_table.jmp");
Ternary Plot( Y( :p1, :p2, :p3 ), Local Data Filter( Add Filter( columns( :p3 ), Where( :p3 >= 0.23 & :p3 <= 0.24 ) ) ) );
New Table( "Test3",
New Column( "X1", Values( [20, 10, 10, 30, 10, 10] ) ),
New Column( "X2", Values( [10, 20, 10, 10, 30, 10] ) ),
New Column( "X3", Values( [10, 10, 20, 10, 10, 30] ) ),
New Column( "Sum", Character( 1 ), "Nominal", Values( {"A", "A", "A", "B", "B", "B"} ) )
);
Code Explanation:
- Open data table;
- Create ternary plot for p1, p2, p3.
- Apply local data filter on p3.
- Define new table named Test3.
- Add column X1 with values.
- Add column X2 with values.
- Add column X3 with values.
- Add column Sum with nominal values.
- Set Sum column type to Nominal.
Example 14
Summary: Creates a ternary plot for quality control monitoring using a predefined data table, with interactive filtering and customization options.
Code:
Open("data_table.jmp");
Ternary Plot( Y( :p1, :p2, :p3 ), Local Data Filter( Add Filter( columns( :p3 ), Where( :p3 >= 0.23 & :p3 <= 0.24 ) ) ) );
New Table( "Test3",
New Column( "X1", Values( [20, 10, 10, 30, 10, 10] ) ),
New Column( "X2", Values( [10, 20, 10, 10, 30, 10] ) ),
New Column( "X3", Values( [10, 10, 20, 10, 10, 30] ) ),
New Column( "Sum", Character( 1 ), "Nominal", Values( {"A", "A", "A", "B", "B", "B"} ) )
);
Ternary Plot( Y( :X1, :X2, :X3 ) );
Code Explanation:
- Open data table;
- Create ternary plot for p1, p2, p3.
- Add local data filter for p3.
- Create new table "Test3".
- Add column X1 with values.
- Add column X2 with values.
- Add column X3 with values.
- Add column Sum with character values.
- Create ternary plot for X1, X2, X3.
Example 15
Summary: Creates a ternary plot for quality control monitoring, utilizing a predefined data table to visualize predicted values.
Code:
dt = Open("data_table.jmp");
Ternary Plot( Y( :X1, :X2, :X3, :X4, :X5 ), Contour Formula( :Y1 Predicted ) );
Code Explanation:
- Open data table;
- Create ternary plot.
- Set Y variables.
- Add contour formula.
Example 16
Summary: Creates a ternary plot from a predefined data table, customizing reference lines and markers for quality control monitoring.
Code:
Open("data_table.jmp");
Ternary Plot(
X( :p1, :p2, :p3 ),
SendToReport(
Dispatch( {}, "1", ScaleBox,
{Add Ref Line( {0.5, 0.6}, "Solid", "Medium Dark Red", "Label", 1, 0.25, Label Settings( {Label Color( "Blue" )} ) )}
),
Dispatch( {}, "Ternary Plot", FrameBox, {Marker Size( 4 ), Marker Drawing Mode( "Normal" )} )
)
);
Code Explanation:
- Open data table;
- Create ternary plot.
- Set plot axes.
- Add reference lines.
- Customize reference line style.
- Customize reference line label.
- Customize reference line label color.
- Customize plot marker size.
- Set marker drawing mode.
- Finalize plot settings.
Example 17
Summary: Creates a ternary plot from a predefined data table, formatting scales and frame size for quality control monitoring.
Code:
Open("data_table.jmp");
Ternary Plot(
Y( :p1, :p2, :p3 ),
SendToReport(
Dispatch( {}, "1", ScaleBox, {Format( "Percent", Use thousands separator( 0 ), 9, 0 )} ),
Dispatch( {}, "2", ScaleBox, {Format( "Percent", Use thousands separator( 0 ), 9, 0 )} ),
Dispatch( {}, "3", ScaleBox, {Format( "Percent", Use thousands separator( 0 ), 9, 0 )} ),
Dispatch( {}, "Ternary Plot", FrameBox, {Frame Size( 352, 324 )} )
)
);
Code Explanation:
- Open data table;
- Create ternary plot.
- Set Y variables.
- Format first scale box.
- Format second scale box.
- Format third scale box.
- Set frame size.
Example 18
Summary: Creates a ternary plot from a predefined data table, visualizing three variables: Screech, Whine, and Roar.
Code:
dt under test = Open("data_table.jmp");
obj = Ternary Plot( Y( :Screech, :Whine, :Roar ) );
Code Explanation:
- Open data table;
- Assign data table to variable.
- Create ternary plot object.
- Set plot variables.
Example 19
Summary: Creates a ternary plot for quality control monitoring by opening a predefined data table and visualizing three variables.
Code:
dt under test = Open("data_table.jmp");
obj = Ternary Plot( Y( :p1, :p2, :p3 ) );
Code Explanation:
- Open table.
- Create ternary plot.
Example 20
Summary: Creates a ternary plot from a predefined data table, showcasing three Y variables: Yat, Yee, and Sam.
Code:
Open("data_table.jmp");
Ternary Plot( Y( :Yat, :Yee, :Sam ) );
Code Explanation:
- Open data table;
- Create ternary plot.
- Set Y variables: Yat, Yee, Sam.
Example 21
Summary: Creates a ternary plot with local data filtering and selection, excluding edge points from a predefined data table.
Code:
dt = Open("data_table.jmp");
obj = Ternary Plot(
Y( :p1, :p2, :p3 ),
Local Data Filter( Add Filter( columns( :p1 ), Where( :p1 >= 0.6 & :p1 <= 0.8 ) ), Mode( Select( 0 ), Show( 1 ), Include( 1 ) ) ),
);
dt << Select Where( :Point Type == "Edge" );
dt << Exclude();
rpt = Report( obj );
Code Explanation:
- Open data table;
- Create ternary plot.
- Add local data filter.
- Filter p1 between 0.6 and 0.8.
- Select edge points.
- Exclude selected points.
- Generate report object.
Example 22
Summary: Creates a ternary plot object using a predefined data table, with X variables p1, p2, and p3, and a contour formula defined by Pred Formula Y.
Code:
dt under test = Open("data_table.jmp");
obj = Ternary Plot( X( :p1, :p2, :p3 ), Contour Formula( :Pred Formula Y ) );
Code Explanation:
- Open data table;
- Create ternary plot object.
- Set X variables: p1, p2, p3.
- Define contour formula: Pred Formula Y.
Example 23
Summary: Creates a ternary plot using absolute values for Mullet, Sheepshead, and Croaker columns from a predefined data table.
Code:
dt = Open("data_table.jmp");
Ternary Plot(
Y(
Transform Column( "Abs[Mullet]", Formula( Abs( :Mullet ) ) ),
Transform Column( "Abs[Sheepshead]", Formula( Abs( :Sheepshead ) ) ),
Transform Column( "Abs[Croaker]", Formula( Abs( :Croaker ) ) )
)
);
Code Explanation:
- Open data table.
- Create ternary plot.
- Transform Mullet column.
- Use absolute value formula.
- Transform Sheepshead column.
- Use absolute value formula.
- Transform Croaker column.
- Use absolute value formula.
- Plot transformed columns.
- Display graph.
Example 24
Summary: Creates a ternary plot for quality control monitoring using a predefined data table, with adjustable marker size and report settings.
Code:
Open("data_table.jmp");
obj = Ternary Plot( Y( :Yat, :Yee, :Sam ), SendToReport( Dispatch( {}, "Ternary Plot", FrameBox, {Marker Size( 6 )} ) ) );
Code Explanation:
- Open data table;
- Create ternary plot object.
- Set Y variables for plot.
- Configure report settings.
- Adjust marker size to 6.
Example 25
Summary: Creates a ternary plot with contour lines based on predicted ratings, utilizing the Ternary Plot platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = Ternary Plot(
X( :Mullet, :Sheepshead, :Croaker ),
Contour Formula( :Predicted Rating ),
SendToReport( Dispatch( {}, "Ternary Plot", FrameBox ), Dispatch( {}, "", Number Col Edit Box( 2 ), set values( [300] ) ) )
);
Code Explanation:
- Open data table;
- Create ternary plot.
- Set X variables: Mullet, Sheepshead, Croaker.
- Use "Predicted Rating" for contours.
- Send report to dispatch.
- Access Ternary Plot frame.
- Find Number Col Edit Box.
- Set value to 2.
- Set values to [300].
Example 26
Summary: Creates a ternary plot from a predefined data table, utilizing the Ternary Plot platform to visualize and analyze three variables.
Code:
dt = Open("data_table.jmp");
obj = Ternary Plot(
X( :Yat, :Yee, :Sam ),
SendToReport(
Dispatch( {}, "Ternary Plot", FrameBox,
{Marker Size( 3 ), Row Legend( Finalist, Color( 1 ), Color Theme( "JMP Default" ), Marker( 1 ), Marker Theme( "Standard" ) )}
)
)
);
Code Explanation:
- Open table.
- Create ternary plot.
- Set X variables.
- Send report message.
- Dispatch to frame box.
- Set marker size.
- Add row legend.
- Set legend color.
- Apply color theme.
- Set marker style.
Example 27
Summary: Creates and customizes ternary plots for quality control monitoring using predefined data tables, with features such as marker size adjustment and row legend settings.
Code:
dt = Open("data_table1.jmp");
obj = Ternary Plot( Y( :Yat, :Yee, :Sam ), SendToReport( Dispatch( {}, "Ternary Plot", FrameBox, {Marker Size( 6 )} ) ) );
Close( dt, NoSave );
dt = Open("data_table2.jmp");
obj = Ternary Plot(
X( :Mullet, :Sheepshead, :Croaker ),
Contour Formula( :Predicted Rating ),
SendToReport( Dispatch( {}, "Ternary Plot", FrameBox ), Dispatch( {}, "", Number Col Edit Box( 2 ), set values( [300] ) ) )
);
Close( dt, NoSave );
dt = Open("data_table1.jmp");
obj = Ternary Plot(
X( :Yat, :Yee, :Sam ),
SendToReport(
Dispatch( {}, "Ternary Plot", FrameBox,
{Marker Size( 3 ), Row Legend( Finalist, Color( 1 ), Color Theme( "JMP Default" ), Marker( 1 ), Marker Theme( "Standard" ) )}
)
)
);
Code Explanation:
- Open data_table1;
- Create ternary plot for Yat, Yee, Sam.
- Set marker size to 6.
- Close data_table1 dataset without saving.
- Open data_table2;
- Create ternary plot for Mullet, Sheepshead, Croaker.
- Add contour formula for Predicted Rating.
- Set number col edit box value to 300.
- Close data_table2 dataset without saving.
- Reopen data_table1 dataset
- Create ternary plot for Yat, Yee, Sam.
- Set marker size to 3.
- Add row legend for Finalist with specific settings.
Example 28
Summary: Creates ternary plots for quality control monitoring, utilizing predefined data tables and customizing marker sizes and row legends.
Code:
Open("data_table.jmp");
obj = Ternary Plot( Y( :Yat, :Yee, :Sam ), SendToReport( Dispatch( {}, "Ternary Plot", FrameBox, {Marker Size( 6 )} ) ) );
dt = Open("data_table.jmp");
obj = Ternary Plot(
X( :Mullet, :Sheepshead, :Croaker ),
Contour Formula( :Predicted Rating ),
SendToReport( Dispatch( {}, "Ternary Plot", FrameBox ), Dispatch( {}, "", Number Col Edit Box( 2 ), set values( [300] ) ) )
);
Close( dt, NoSave );
dt = Open("data_table.jmp");
obj = Ternary Plot(
X( :Yat, :Yee, :Sam ),
SendToReport(
Dispatch( {}, "Ternary Plot", FrameBox,
{Marker Size( 3 ), Row Legend( Finalist, Color( 1 ), Color Theme( "JMP Default" ), Marker( 1 ), Marker Theme( "Standard" ) )}
)
)
);
Code Explanation:
- Open data table;
- Create ternary plot.
- Set marker size to 6.
- Open data table;
- Create ternary plot.
- Set X variables.
- Add contour formula.
- Set contour levels to 300.
- Close "Fish Patty.jmp".
- Open data table;
- Create ternary plot.
- Set X variables.
- Set marker size to 3.
- Add row legend for "Finalist".
Ternary Plot using Set Values
Summary: Creates and analyzes a ternary plot, setting missing value codes and generating a report.
Code:
dt = Open("data_table.jmp");
:Yat << Set Values( {0, 0, 0, 0} );
obj = Ternary Plot( Y( :Yat, :Yee, :Sam ) );
:Yat << Set Property( "Missing Value Codes", 0 );
obj2 = obj << Redo Analysis;
rpt = obj2 << Report;
expr = rpt << Get Journal;
p = "x(.,.,.,.,";
ans = Pat Match( expr, p );
Code Explanation:
- Open data table;
- Set :Yat values to {0, 0, 0, 0}.
- Create Ternary Plot.
- Set :Yat missing value code to 0.
- Redo analysis.
- Generate report.
- Extract journal expression.
- Define pattern "x(.,.,.,.,".
- Match pattern in expression.
- Store match result.