Overlay Plot
Example 1
Summary: Visualizes the relationship between City Mileage (MPG) and Highway Mileage (MPG) using an Overlay Plot, enabling Range Plot for dispersion analysis.
Code:
// Overlay Plot
// Open data table
dt = Open("data_table.jmp");
// Overlay Plot
Overlay Plot(
Y(
:"City Mileage (MPG)"n,
:"Highway Mileage (MPG)"n
),
Range Plot( 1 )
);
Code Explanation:
- Open data table;
- Create Overlay Plot.
- Set Y-axis to "City Mileage (MPG)".
- Add "Highway Mileage (MPG)" to Y-axis.
- Enable Range Plot.
Example 2
Summary: Visualizes the overlay plot of normal and t-densities for a given data set, providing an interactive visualization of the distribution.
Code:
// Overlay Plot Nomal and t
// Open data table
dt = Open("data_table.jmp");
// Overlay Plot Nomal and t
Overlay Plot(
X( :X ),
Y( :Normal dens, :t dens5 ),
Function Plot( 1 ),
Show Points( 0 )
);
Code Explanation:
- Open data table.
- Create overlay plot.
- Set X variable.
- Add Normal density.
- Add t density.
- Enable function plot.
- Disable point display.
Example 3
Summary: Visualizes the relationship between Xbeta and beta coefficients using an overlay plot, with customizable scales for both axes.
Code:
// Overlay Plot for Betas
// Open data table
dt = Open("data_table.jmp");
// Overlay Plot for Betas
Overlay Plot(
X( :Xbeta ),
Y( :beta.5.5, :beta52, :beta2.5 ),
Overlay Axis << {{Scale( "Linear" ),
Format( "Best" ), Min( -1 ), Max( 5 ),
Inc( 1 ), Minor Ticks( 0 )}},
X Axis << {{Scale( "Linear" ),
Format( "Best" ), Min( 0.05 ),
Max( 0.95 ), Inc( 0.1 )}},
Function Plot( 1 ),
Show Points( 0 ),
SendToReport(
Dispatch( {}, "102", ScaleBox,
{Scale( "Linear" ),
Format( "Best" ), Min( -1 ),
Max( 5 ), Inc( 1 ),
Minor Ticks( 0 )}
),
Dispatch( {}, "101", ScaleBox,
{Scale( "Linear" ),
Format( "Best" ), Min( 0.05 ),
Max( 0.95 ), Inc( 0.1 )}
)
)
);
Code Explanation:
- Open data table.
- Create overlay plot.
- Set X variable.
- Set Y variables.
- Configure overlay axis scale.
- Configure X axis scale.
- Add function plot.
- Hide points.
- Send report settings.
- Adjust overlay scale box.
- Adjust X scale box.
Example 4
Summary: Visualizes the relationship between Xgamma and gamma values using an overlay plot, with function plots enabled and point display disabled.
Code:
// Overlay Plot for Gammas
// Open data table
dt = Open("data_table.jmp");
// Overlay Plot for Gammas
Overlay Plot(
X( :Xgamma ),
Y( :gamma1, :gamma3, :gamma5 ),
Function Plot( 1 ),
Show Points( 0 )
);
Code Explanation:
- Open table.
- Create overlay plot.
- Set X-axis to :Xgamma.
- Add :gamma1 to Y-axis.
- Add :gamma3 to Y-axis.
- Add :gamma5 to Y-axis.
- Enable function plot.
- Disable point display.
Example 5
Summary: Visualizes Weibull distributions with an overlay plot, showcasing the relationships between three variables using JMP's Overlay Plot function.
Code:
// Overlay Plot for Weibulls
// Open data table
dt = Open("data_table.jmp");
// Overlay Plot for Weibulls
Overlay Plot(
X( :XWeibull ),
Y( :Weibull11, :Weibul12, :Weibul21 ),
Function Plot( 1 ),
Show Points( 0 )
);
Code Explanation:
- Open table.
- Create overlay plot.
- Set X-axis variable.
- Add Y-axis variables.
- Enable function plot.
- Hide data points.
Example 6
Summary: Visualizes the relationship between X and Y variables using an overlay plot, with Pred Y series connected and hidden, and Y series colored by group.
Code:
// Overlay Plot
// Open data table
dt = Open("data_table.jmp");
// Overlay Plot
Overlay Plot(
X( :X ),
Y( :Pred Y, :Y ),
:
Pred Y(
Connect Points( 1 ),
Show Points( 0 )
),
:Y( Connect Color( 5 ) )
);
Code Explanation:
- Open data table.
- Create overlay plot.
- Set X axis variable.
- Add Y variables.
- Configure Pred Y series.
- Connect Pred Y points.
- Hide Pred Y points.
- Configure Y series.
- Color Y lines by group.
- Display plot.
Example 7
Summary: Visualizes the relationship between x and y variables using an overlay plot, allowing for a detailed analysis of DJI High, Close, and Low values.
Code:
// Overlay Plot
// Open data table
dt = Open("data_table.jmp");
// Overlay Plot
Overlay Plot( X( :x ), Y( :y ) );
Code Explanation:
- Open data table.
- Create overlay plot.
- Set X-axis variable.
- Set Y-axis variable.
Example 8
Summary: Visualizes the portion of a specific age group in each country over time, using an overlay plot to display the data with grouping by country.
Code:
// Overlay Plot
// Open data table
dt = Open("data_table.jmp");
// Overlay Plot
Overlay Plot(
X( :Year ),
Y( :"Portion 0-19"n ),
Grouping( :Country ),
Overlay Groups,
X Axis << {{Scale( "Linear" ),
Format( "Best" ), Min( 1957.5 ),
Max( 2000 ), Inc( 10 ),
Minor Ticks( 9 ),
Show Major Grid( 1 ),
Show Minor Grid( 1 )}},
Connect Points( 1 )
);
Code Explanation:
- Open table.
- Create overlay plot.
- Set X variable.
- Set Y variable.
- Define grouping.
- Enable overlay groups.
- Configure X axis scale.
- Set X axis format.
- Set X axis min value.
- Set X axis max value.
Example 9
Summary: Visualizes moving averages for the XYZ variable over time, using an overlay plot to display both the original data and the calculated moving average.
Code:
// Overlay Plot: Moving Averages
// Open data table
dt = Open("data_table.jmp");
// Overlay Plot: Moving Averages
Overlay Plot(
X( :Date ),
Y( :XYZ, :moving avg. )
);
Code Explanation:
- Open data table.
- Create overlay plot.
- Set X-axis to Date.
- Add XYZ to Y-axis.
- Add moving avg. to Y-axis.
Example 10
Summary: Visualizes the daily movement of DJI High, Close, and Low values over time using an overlay plot with a needle style, providing a detailed view of market fluctuations.
Code:
// Overlay Plot: Needle
// Open data table
dt = Open("data_table.jmp");
// Overlay Plot: Needle
Overlay Plot(
X( :Date ),
Y( :DJI High, :DJI Close, :DJI Low ),
Needle( 1 )
);
Code Explanation:
- Open data table.
- Create overlay plot.
- Set X-axis to Date.
- Add DJI High, Close, Low to Y-axis.
- Enable needle plot style.
Example 11
Summary: Creates an overlay plot to visualize the relationship between 'name' and 'height', using separate axes for clarity.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
Overlay Plot( X( :name ), Y( :height ), Separate Axes( 1 ) );
Code Explanation:
- Set default names.
- Open data_table data
- Create overlay plot.
- Set X axis to "name".
- Set Y axis to "height".
- Enable separate axes.
Example 12
Summary: Creates an overlay plot to visualize height data, configuring Y-axis settings and sending a report dispatch.
Code:
Open("data_table.jmp");
Overlay Plot(
Y( :height ),
Y Axis[1] << {{Format( "Best", 12 ), Min( -4.2 ), Max( 4.2 ), Inc( 0.2 ), Minor Ticks( 1 )}},
Separate Axes( 1 ),
SendToReport( Dispatch( {}, "106", ScaleBox, {Format( "Best", 12 ), Min( -4.2 ), Max( 4.2 ), Inc( 0.2 ), Minor Ticks( 1 )} ) )
);
Code Explanation:
- Open data table;
- Create overlay plot.
- Set Y variable to height.
- Configure Y axis settings.
- Enable separate axes.
- Send report dispatch.
- Format scale box.
- Set minimum value.
- Set maximum value.
- Set increment value.
Example 13
Summary: Creates an Overlay Plot with customized scales for measurement analysis, displaying values in a user-friendly format.
Code:
dt = Open("data_table.jmp");
Overlay Plot(
X( :April ),
Y( :Name( "Humid1:PM" ), :Name( "Humid4:PM" ) ),
SendToReport(
Dispatch( {}, "102", ScaleBox,
{Format( "Custom", Formula( If( value != 100, Substitute( Char( value ), "0", " tens" ), "10 tens" ) ), 11 )}
),
Dispatch( {}, "101", ScaleBox, {Format( "Custom", Formula( If( value > 30, "DNE", value ) ), 5 )} )
)
);
Code Explanation:
- Open data table;
- Create an Overlay Plot.
- Set X-axis to April.
- Set Y-axes to Humid1:PM and Humid4:PM.
- Customize Y1 scale format.
- Replace "0" with " tens".
- Replace "100" with "10 tens".
- Set Y2 scale format.
- Display "DNE" for values over 30.
- Display actual values for Y2 otherwise.
Example 14
Summary: Creates an overlay plot to visualize height and weight against age, utilizing the Overlay Plot platform in JMP.
Code:
dt = Open("data_table.jmp");
obj = dt << Overlay Plot( X( :age ), Y( :height, :weight ) );
Report( obj )[Outline Box( 1 )] << Set Title( "Height & Weight vs. Age" );
Code Explanation:
- Open data table.
- Create overlay plot object.
- Set X-axis to age.
- Set Y-axes to height and weight.
- Access report object.
- Locate first outline box.
- Set title for plot.
Example 15
Summary: Creates an overlay plot to visualize height and weight data against age, with a bold title and centered text box.
Code:
dt = Open("data_table.jmp");
obj = dt << Overlay Plot( X( :age ), Y( :height, :weight ) );
Report( obj )[Outline Box( 1 )] << Set Title( "Height & Weight vs. Age" );
(Report( obj )[Outline Box( 1 )] << Child) << Prepend(
H Center Box( tb = Text Box( "Height & Weight vs. Age", <<Set Font Style( "Bold" ) ) )
);
Code Explanation:
- Open data table.
- Create overlay plot object.
- Set main title for graph.
- Add centered bold text box.
- Place text box at top.
Example 16
Summary: Creates an overlay plot to visualize two variables, Humid1:PM and Humid4:PM, with April as the x-axis.
Code:
Open("data_table.jmp");
Overlay Plot( X( :April ), Y( :Name( "Humid1:PM" ), :Name( "Humid4:PM" ) ), Overlay( 0 ), Connect Points( 1 ) );
Code Explanation:
- Open data_table data
- Create overlay plot.
- Set X-axis to April.
- Add Humid1:PM to Y-axis.
- Add Humid4:PM to Y-axis.
- Disable overlay.
- Connect data points.
Example 17
Summary: Creates an overlay plot to visualize stock market data, with X-axis set to Date and Y-axes for High, Low, Close, and Volume.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Overlay Plot( X( :Date ), Y( :High, :Low, :Close, :Volume ), Y Scale( Left, Left, Left, Right ) );
Code Explanation:
- Set default names.
- Open data table.
- Create overlay plot object.
- Set X axis to Date.
- Set Y axes for High, Low, Close, Volume.
- Assign Y scales: Left, Left, Left, Right.
Example 18
Summary: Creates an overlay plot to visualize the relationship between weight and height, grouped by age, with specific color and marker settings for group 2.
Code:
Open("data_table.jmp");
Overlay Plot( X( :weight ), Y( :height ), Grouping( :age ), Overlay Groups( Group[2] << Group Color( 25 ) << Group Marker( 11 ) ) );
Code Explanation:
- Open data table;
- Create overlay plot.
- Set X axis to weight.
- Set Y axis to height.
- Group by age.
- Overlay groups by age.
- Set group 2 color.
- Set group 2 marker.
Example 19
Summary: Creates an overlay plot to visualize the relationship between height and weight, grouped by age, in a data table.
Code:
Open("data_table.jmp");
Overlay Plot(
X( :height ),
Y( :weight ),
Grouping( :age ),
SendToReport(
Dispatch( {}, "Overlay Plot Graph", FrameBox, {Frame Size( 252, 81 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 2 ), {Frame Size( 252, 81 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 3 ), {Frame Size( 252, 81 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 4 ), {Frame Size( 252, 81 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 5 ), {Frame Size( 252, 81 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 6 ), {Frame Size( 252, 81 )} )
)
);
Code Explanation:
- Open data table.
- Create overlay plot.
- Set X axis to height.
- Set Y axis to weight.
- Group by age.
- Adjust frame size for graph.
- Adjust frame size for graph.
- Adjust frame size for graph.
- Adjust frame size for graph.
- Adjust frame size for graph.
Example 20
Summary: Creates an overlay plot to visualize two humidity levels (Humid1:PM and Humid4:PM) for April, utilizing the Overlay Plot platform in JMP.
Code:
dt = Open("data_table.jmp");
dt << Select all Rows << Label;
dt << clear select;
Overlay Plot( X( :April ), Y( :Name( "Humid1:PM" ), :Name( "Humid4:PM" ) ) );
Code Explanation:
- Open data table;
- Select all rows in table.
- Label selected rows.
- Clear row selection.
- Create overlay plot.
- Set X-axis to April.
- Add Humid1:PM to Y-axis.
- Add Humid4:PM to Y-axis.
Example 21
Summary: Creates an overlay plot to visualize the relationship between Humid1:PM and Humid4:PM in April, with specific row selection and labeling.
Code:
dt = Open("data_table.jmp");
dt << Select all Rows << Label;
dt << clear select;
Overlay Plot( X( :April ), Y( :Name( "Humid1:PM" ), :Name( "Humid4:PM" ) ) );
dt << Select Rows( {27, 28, 29, 30} );
Code Explanation:
- Open data table.
- Select all rows.
- Label selected rows.
- Clear row selection.
- Create overlay plot.
- Set X axis to April.
- Add Humid1:PM to Y axis.
- Add Humid4:PM to Y axis.
- Select specific rows.
- Highlight selected rows.
Example 22
Summary: Creates an overlay plot to visualize DJI High, Close, and Low values over time, with interactive features for customization.
Code:
Open("data_table.jmp");
Overlay Plot(
X( :Date ),
Y( :DJI High, :DJI Close, :DJI Low ),
:DJI High( Connect Points( 1 ), Overlay Marker( 8 ) ),
:DJI Close( Needle( 1 ), Overlay Marker( 1 ) ),
:DJI Low( Connect Points( 1 ) ),
SendToReport( Dispatch( {}, "101", ScaleBox, {Label Row( Label Orientation( "Vertical" ) )} ) )
);
Code Explanation:
- Open data table;
- Create overlay plot.
- Set X-axis to Date.
- Add DJI High to Y-axis.
- Add DJI Close to Y-axis.
- Add DJI Low to Y-axis.
- Connect DJI High points.
- Overlay DJI High markers.
- Use needle for DJI Close.
- Overlay DJI Close markers.
- Connect DJI Low points.
- Set vertical label orientation.
Example 23
Summary: Creates an overlay plot to visualize DJI High, Close, and Low values over time, using the Needle plot style.
Code:
Open("data_table.jmp");
Overlay Plot( X( :Date ), Y( :DJI High, :DJI Close, :DJI Low ), Needle( 1 ) );
Code Explanation:
- Open data table;
- Create overlay plot.
- Set X-axis to Date.
- Add DJI High series.
- Add DJI Close series.
- Add DJI Low series.
- Enable needle plot style.
Example 24
Summary: Creates an overlay plot with grouped data, adjusting frame sizes and background colors for each graph.
Code:
Open("data_table.jmp");
Overlay Plot(
X( :weight ),
Y( :height ),
Grouping( :age, :sex ),
SendToReport(
Dispatch( {}, "Overlay Plot Graph", FrameBox, {Frame Size( 180, 100 ), Background Color( 41 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 2 ), {Frame Size( 180, 100 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 3 ), {Frame Size( 180, 100 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 4 ), {Frame Size( 180, 100 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 5 ), {Frame Size( 180, 100 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 6 ), {Frame Size( 180, 100 ), Background Color( 38 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 7 ), {Frame Size( 180, 100 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 8 ), {Frame Size( 180, 100 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 9 ), {Frame Size( 180, 100 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 10 ), {Frame Size( 180, 100 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 11 ), {Frame Size( 180, 100 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox( 12 ), {Frame Size( 180, 100 )} )
)
);
Code Explanation:
- Open data table;
- Create overlay plot.
- Set X-axis to weight.
- Set Y-axis to height.
- Group by age and sex.
- Send report settings.
- Adjust frame size for each graph.
- Set background color for specific frames.
- Repeat frame size adjustments for all graphs.
- Finalize report layout.
Example 25
Summary: Creates an overlay plot with multiple Y axes, including log scaling on the left axis, using the Overlay Plot function in JMP.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Overlay Plot( X( :Date ), Y( :High, :Low, :Close, :Volume ), Y Scale( Right, Right, Right, Left ), Left Y Log Scale( 1 ) );
Code Explanation:
- Set default names scope.
- Open data table.
- Create Overlay Plot object.
- Set X axis to Date.
- Set Y axes to High, Low, Close, Volume.
- Set Y scales: Right, Right, Right, Left.
- Enable log scale on left Y axis.
Example 26
Summary: Creates an overlay plot to visualize profit data, utilizing the Overlay Plot platform in JMP.
Code:
Open("data_table.jmp");
Overlay Plot( Y( :Name( "Profit($M)" ) ) );
Code Explanation:
- Open data table;
- Create overlay plot.
- Set Y axis variable.
Example 27
Summary: Creates an overlay plot to visualize and compare ozone, CO, and SO2 levels across different regions.
Code:
dt = Open("data_table.jmp");
obj = Overlay Plot( X( :X ), Y( :OZONE, :CO, :SO2 ), Grouping( :Region ) );
Code Explanation:
- Open data table;
- Create overlay plot object.
- Set X variable to :X.
- Add Y variables :OZONE, :CO, :SO2.
- Group by :Region.
Example 28
Summary: Creates an overlay plot to visualize and compare ozone, carbon monoxide, and sulfur dioxide levels across regions.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Overlay Plot( X( :X ), Y( :OZONE, :CO, :SO2 ), Grouping( :Region ) );
obj << Overlay Groups( 1 );
Code Explanation:
- Set default names.
- Open data table.
- Create overlay plot.
- Set X-axis to :X.
- Set Y-axes to :OZONE, :CO, :SO2.
- Group by :Region.
- Overlay groups.
Example 29
Summary: Creates an overlay plot with multiple Y axes, displaying High, Low, Close, and Volume data over time.
Code:
dt = Open("data_table.jmp");
obj = Overlay Plot( X( :Date ), Y( :High, :Low, :Close, :Volume ), Y Scale( Left, Left, Left, Right ) );
obj << Overlay( 0 );
Code Explanation:
- Open data_table data
- Create Overlay Plot object.
- Set X axis to Date.
- Set Y axes for High, Low, Close, Volume.
- Assign Y scales: Left, Left, Left, Right.
- Overlay plots on separate axes.
Example 30
Summary: Creates an overlay plot with separate axes for High, Low, Close, and Volume data, using the Overlay Plot platform in JMP.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Overlay Plot( X( :Date ), Y( :High, :Low, :Close, :Volume ), Y Scale( Left, Left, Left, Right ) );
obj << Overlay( 0 );
obj << Separate Axes( 1 );
Code Explanation:
- Set default names.
- Open data table.
- Create overlay plot.
- Set X axis to Date.
- Set Y axes for High, Low, Close, Volume.
- Assign Left scale to High, Low, Close.
- Assign Right scale to Volume.
- Overlay plots.
- Separate axes.
- Execute script.
Example 31
Summary: Creates an overlay plot to visualize the relationship between POP and OZONE, NO, SO2 variables with a log-scaled X-axis.
Code:
Names Default To Here( 1 );
dt = Open("data_table.jmp");
obj = Overlay Plot( X( :POP ), Y( :OZONE, :NO, :SO2 ), X Log Scale( 1 ) );
Code Explanation:
- Set default names scope.
- Open data table.
- Create overlay plot object.
- Set X-axis to log scale.
- Plot POP on X-axis.
- Plot OZONE, NO, SO2 on Y-axis.
Example 32
Summary: Creates an overlay plot to visualize and compare City Mileage (MPG) and Highway Mileage (MPG) data, with options for connect thru missing values and ungrouped plots.
Code:
dt under test = Open("data_table.jmp");
obj = Overlay Plot(
Y( :Name( "City Mileage (MPG)" ), :Name( "Highway Mileage (MPG)" ) ),
Overlay( 0 ),
Range Plot( 1 ),
Ungroup Plots( 1 ),
Connect Thru Missing( 1 ),
SendToReport(
Dispatch( {}, "Overlay Plot", OutlineBox, {Set Title( "Overlay Plots: No Overlay; Connect Thru Missing, Ungroup Plots" )} )
)
);
Code Explanation:
- Open data table.
- Create overlay plot object.
- Set Y variables.
- Enable overlay.
- Enable range plot.
- Enable ungroup plots.
- Enable connect thru missing.
- Send report to display.
- Set plot title.
- Display final plot.
Example 33
Summary: Creates an overlay plot to visualize and compare City Mileage (MPG) and Highway Mileage (MPG) using the Range Plot feature.
Code:
Open("data_table.jmp");
obj = Overlay Plot( Y( :Name( "City Mileage (MPG)" ), :Name( "Highway Mileage (MPG)" ) ), Range Plot( 1 ) );
Code Explanation:
- Open data table;
- Create overlay plot object.
- Set Y variables for plot.
- Add range plot to overlay.
- Configure range plot settings.
Example 34
Summary: Creates an overlay plot to visualize two variables (Humid1:PM and Humid4:PM) over time, using the Open and Overlay Plot JSL functions.
Code:
Open("data_table.jmp");
Overlay Plot( X( :April ), Y( :Name( "Humid1:PM" ), :Name( "Humid4:PM" ) ) );
Code Explanation:
- Open data table;
- Create overlay plot.
- Set X-axis variable.
- Add first Y-axis variable.
- Add second Y-axis variable.
Example 35
Summary: Creates an overlay plot to visualize two variables (Humid1:PM and Humid4:PM) for specific rows in a data table.
Code:
dt = Open("data_table.jmp");
Overlay Plot( X( :April ), Y( :Name( "Humid1:PM" ), :Name( "Humid4:PM" ) ) );
dt << Select Rows( {27, 28, 29, 30} );
Code Explanation:
- Open table.
- Create overlay plot.
- Set X axis variable.
- Set Y axis variables.
- Select specific rows.
Example 36
Summary: Creates an overlay plot to visualize the relationship between height and weight, grouped by age.
Code:
Open("data_table.jmp");
Overlay Plot( X( :height ), Y( :weight ), Grouping( :age ), Overlay Groups );
Code Explanation:
- Open data table;
- Create overlay plot.
- Set X-axis to height.
- Set Y-axis to weight.
- Group by age.
- Display overlay groups.
Example 37
Summary: Creates an overlay plot with local data filtering to analyze gamma values based on Xgamma ranges, and generates a report for further analysis.
Code:
dt = Open("data_table.jmp");
obj = Overlay Plot(
X( :Xgamma ),
Y( :gamma1, :gamma3, :gamma5 ),
Local Data Filter(
Add Filter( columns( :Xgamma ), Where( :Xgamma >= 0.5 & :Xgamma <= 10 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
),
);
obj << Automatic Recalc( 0 );
dt << Select Where( :X <= 0 );
dt << Exclude();
rpt = Report( obj );
Code Explanation:
- Open data table.
- Create overlay plot object.
- Set X axis variable.
- Set Y axis variables.
- Add local data filter.
- Define filter conditions.
- Set filter mode.
- Disable automatic recalculation.
- Select rows where X <= 0.
- Exclude selected rows from analysis.
Example 38
Summary: Creates and updates an overlay plot with filtered data, utilizing a local data filter to select specific rows based on the Xgamma column.
Code:
dt = Open("data_table.jmp");
obj = Overlay Plot(
X( :Xgamma ),
Y( :gamma1, :gamma3, :gamma5 ),
Local Data Filter(
Add Filter( columns( :Xgamma ), Where( :Xgamma >= 0.5 & :Xgamma <= 10 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
),
);
obj << Automatic Recalc( 1 );
dt << Select Where( :X <= 0 );
dt << Exclude();
rpt = Report( obj );
Close( dt, NoSave );
dt = Open("data_table.jmp");
obj = Overlay Plot(
X( :Xgamma ),
Y( :gamma1, :gamma3, :gamma5 ),
Local Data Filter(
Add Filter( columns( :Xgamma ), Where( :Xgamma >= 0.5 & :Xgamma <= 10 ) ),
Mode( Select( 0 ), Show( 1 ), Include( 1 ) )
),
);
obj << Automatic Recalc( 0 );
dt << Select Where( :X <= 0 );
dt << Exclude();
rpt = Report( obj );
Code Explanation:
- Open data table;
- Create overlay plot.
- Set X-axis to :Xgamma.
- Set Y-axes to :gamma1, :gamma3, :gamma5.
- Add local data filter.
- Filter :Xgamma between 0.5 and 10.
- Enable automatic recalculation.
- Select rows where :X <= 0.
- Exclude selected rows.
- Generate report.
- Close "data_table.jmp" without saving.
- Reopen "data_table.jmp".
- Create overlay plot again.
- Set X-axis to :Xgamma.
- Set Y-axes to :gamma1, :gamma3, :gamma5.
- Add local data filter.
- Filter :Xgamma between 0.5 and 10.
- Disable automatic recalculation.
- Select rows where :X <= 0.
- Exclude selected rows.
- Generate report.
Example 39
Summary: Creates an overlay plot to visualize and compare City Mileage (MPG) and Highway Mileage (MPG) using the Range Plot feature.
Code:
dt under test = Open("data_table.jmp");
obj = Overlay Plot( Y( :Name( "City Mileage (MPG)" ), :Name( "Highway Mileage (MPG)" ) ), Range Plot( 1 ) );
Code Explanation:
- Open data table;
- Create overlay plot object.
- Set Y variables for plot.
- Add range plot feature.
Example 40
Summary: Creates an Overlay Plot to visualize flight data, combining concatenated flight numbers with transformed time of day and original time, grouped by first event word and last airport word.
Code:
dt = Open("data_table.jmp");
Overlay Plot(
X( Transform Column( "Concatenate[Flight Number,Tail Number]", Character, Formula( :Flight Number || ", " || :Tail Number ) ) ),
Y(
Transform Column( "Time of Day[Time]", Format( "h:m", 8 ), Formula( Time Of Day( :Time ) ) ),
Transform Column( "Time of Day[Original Time]", Format( "h:m", 8 ), Formula( Time Of Day( :Original Time ) ) )
),
Y Scale( Left, Right ),
Grouping( Transform Column( "First[Event]", Character, Formula( Word( 1, :Event ) ) ) ),
By( Transform Column( "Last[Airport]", Character, Formula( Word( -1, :Airport ) ) ) )
);
Code Explanation:
- Open data table;
- Create Overlay Plot.
- Set X-axis to concatenated flight numbers.
- Set Y-axis to transformed time of day.
- Set second Y-axis to original time of day.
- Use left and right scales for Y-axes.
- Group by first word in event.
- By last word in airport.
- Transform flight number and tail number.
- Transform time of day and original time.
Example 41
Summary: Creates an overlay plot for weight and subsequent data table modifications, including column deletion and row selection.
Code:
dt = Open("data_table.jmp");
obj = Overlay Plot( Y( :weight ) );
dt << delete columns( weight );
dt << select rows( [1, 2, 3] );
dt << exclude;
Code Explanation:
- Open data table;
- Create overlay plot for weight.
- Delete weight column.
- Select first three rows.
- Exclude selected rows.
Example 42
Summary: Creates an Overlay Plot to visualize stock market data, with customizable Y-axis scales and marker drawing mode.
Code:
dt = Open("data_table.jmp");
obj = Overlay Plot(
X( :Date ),
Y( :High, :Low, :Close, :Volume ),
Y Scale( Left, Left, Left, Right ),
SendToReport( Dispatch( {}, "Overlay Plot Graph", FrameBox, {Marker Drawing Mode( "Fast" )} ) )
);
Code Explanation:
- Open data table;
- Create Overlay Plot.
- Set X axis to Date.
- Set Y axes: High, Low, Close, Volume.
- Assign Y scales: Left, Left, Left, Right.
- Send report message.
- Dispatch to Overlay Plot Graph.
- Select FrameBox.
- Set Marker Drawing Mode to Fast.
Example 43
Summary: Creates two overlay plots with connected points to visualize April data for Humid1:PM and Humid4:PM.
Code:
Open("data_table.jmp");
obj = Overlay Plot( X( :April ), Y( :Name( "Humid1:PM" ), :Name( "Humid4:PM" ) ) );
obj = Overlay Plot( X( :April ), Y( :Name( "Humid1:PM" ), :Name( "Humid4:PM" ) ), Connect Points( 1 ) );
Code Explanation:
- Open data table;
- Create overlay plot.
- Set X axis to April.
- Set Y axes to Humid1:PM and Humid4:PM.
- Create second overlay plot.
- Set X axis to April.
- Set Y axes to Humid1:PM and Humid4:PM.
- Connect points in plot.
Example 44
Summary: Creates an overlay plot to visualize stock market data, with X-axis set to date and Y-axis scales for high, low, close, and volume.
Code:
dt = Open("data_table.jmp");
obj = Overlay Plot( X( :Date ), Y( :High, :Low, :Close, :Volume ), Y Scale( Left, Left, Left, Right ), Connect Points( 1 ) );
Code Explanation:
- Open data table;
- Create overlay plot.
- Set X axis to :Date.
- Add :High, :Low, :Close, :Volume to Y.
- Set Y scales: Left, Left, Left, Right.
- Connect data points for each series.
Example 45
Summary: Creates overlay plots with grouping by age and sex, allowing for separate axes and overlay groups.
Code:
dt = Open("data_table.jmp");
obj = Overlay Plot( X( :height ), Y( :weight ), Grouping( :age, :sex ) );
obj = Overlay Plot( X( :height ), Y( :weight ), Grouping( :age, :sex ), Separate Axes( 1 ) );
obj = Overlay Plot( X( :height ), Y( :weight ), Grouping( :sex ) );
obj = Overlay Plot( X( :height ), Y( :weight ), Grouping( :sex ), Overlay Groups );
Code Explanation:
- Open data table;
- Create overlay plot.
- Set grouping by age and sex.
- Separate axes for groups.
- Change grouping to sex.
- Overlay groups by sex.
Example 46
Summary: Creates overlay plots to visualize and compare humidity data over time, with options for separate axes and step plots.
Code:
dt = Open("data_table.jmp");
obj = Overlay Plot( X( :date ), Y( :Name( "Humid1:PM" ), :Name( "Humid4:PM" ) ), Overlay( 0 ), Connect Points( 1 ) );
obj = Overlay Plot( X( :date ), Y( :Name( "Humid1:PM" ), :Name( "Humid4:PM" ) ), Overlay( 0 ), Separate Axes( 1 ), Connect Points( 1 ) );
obj = Overlay Plot( Y( :Name( "Humid4:PM" ) ), Step( 1 ), Show Points( 0 ) );
Code Explanation:
- Open data table;
- Create overlay plot.
- Set X-axis to date.
- Set Y-axes to Humid1:PM and Humid4:PM.
- Disable overlay.
- Connect data points.
- Create another overlay plot.
- Set X-axis to date.
- Set Y-axes to Humid1:PM and Humid4:PM.
- Enable separate axes.
- Connect data points.
- Create step plot for Humid4:PM.
- Hide data points.
Example 47
Summary: Creates an overlay plot to visualize relationships between height, weight, and demographic factors (age and sex) in a data table.
Code:
dt = Open("data_table.jmp");
obj = Overlay Plot( X( :height ), Y( :weight ), Grouping( :age, :sex ) );
rpt = obj << report;
Code Explanation:
- Open data table;
- Create Overlay Plot.
- Set X-axis to height.
- Set Y-axis to weight.
- Group by age and sex.
- Generate report object.
Example 48
Summary: Creates an overlay plot to visualize height and weight data, with customizable Y-axis limits and separate axes.
Code:
Open("data_table.jmp");
obj = Overlay Plot(
X( :height ),
Y( :weight ),
Y Axis[1] << {{Min( 180 ), Max( 60 ), Inc( 20 )}},
Separate Axes( 1 ),
Connect Thru Missing( 1 ),
Connect Points( 1 ),
SendToReport(
Dispatch( {}, "106", ScaleBox, {Min( 180 ), Max( 60 ), Inc( 20 )} ),
Dispatch( {}, "Overlay Plot Graph", FrameBox, Add Graphics Script( 2, Description( "Script" ), Circle( {60, 120}, 10 ) ) )
)
);
rpt = obj << report;
Code Explanation:
- Open data table.
- Create overlay plot object.
- Set X-axis to height.
- Set Y-axis to weight.
- Customize Y-axis limits.
- Enable separate axes.
- Connect points through missing values.
- Connect individual points.
- Send report to script.
- Add circle to graph.
Overlay Plot using If
Example 1
Summary: Creates an overlay plot on a data table, displaying DJI High, Close, and Low series with needle plots enabled.
Code:
If( Host is( "Windows" ),
Open("data_table.jmp");
Overlay Plot( X( :Date ), Y( :DJI High, :DJI Close, :DJI Low ), Needle( 1 ) );
);
Code Explanation:
- Check if host is Windows.
- Open data table;
- Create overlay plot.
- Set X axis to Date.
- Add DJI High series.
- Add DJI Close series.
- Add DJI Low series.
- Enable needle plot.
Example 2
Summary: Creates an overlay plot to visualize City and Highway Mileage data on a Windows platform.
Code:
If( Host is( "Windows" ),
dt under test = Open("data_table.jmp");
obj = Overlay Plot( Y( :Name( "City Mileage (MPG)" ), :Name( "Highway Mileage (MPG)" ) ), Range Plot( 1 ) );
);
Code Explanation:
- Check if host is Windows.
- Open data table;
- Create Overlay Plot object.
- Set Y variables: City and Highway Mileage.
- Add Range Plot with index 1.
Overlay Plot using Select Rows
Summary: Creates an overlay plot with separate axes, grouping data by sex, using a specific range of rows from a data table.
Code:
dt = Open("data_table.jmp");
dt << Select Rows( {16, 17, 18, 19, 20} );
dt << Overlay Plot( X( :age ), Y( :height ), Separate Axes( 1 ), By( :sex ) );
Code Explanation:
- Open data table.
- Select specific rows.
- Create overlay plot.
- Set X-axis variable.
- Set Y-axis variable.
- Enable separate axes.
- Group by sex.
Overlay Plot using Insert Into
Summary: Creates a new window with an overlay plot, grouping data by 'sex' and displaying 'height' on the X-axis and 'weight' on the Y-axis.
Code:
dt = Open("data_table.jmp");
dtCol = {};
Insert Into( dtCol, Column( "sex" ) );
New Window( "Try Crash", op = Overlay Plot( X( :Name( "height" ) ), Y( :Name( "weight" ) ), By( Eval( dtCol ) ) ) );
Code Explanation:
- Open data table.
- Initialize empty list.
- Insert column "sex" into list.
- Create new window titled "Try Crash".
- Define overlay plot object.
- Set X axis to "height".
- Set Y axis to "weight".
- Group plots by "sex".
Overlay Plot using Set Values
Summary: Creates and compares overlay plots with initial and revised reports, utilizing JMP's reporting features.
Code:
dt = Open("data_table.jmp");
:"Humid1:PM" << Set Values( {1, 1, 1, 1, 1, 1} );
obj = Overlay Plot( X( :April ), Y( :Name( "Humid1:PM" ), :Name( "Humid4:PM" ) ) );
rpt1 = obj << report;
expr1 = rpt1 << get journal;
:"Humid1:PM" << Set Property( "Missing Value Codes", 1 );
obj2 = obj << Redo Analysis;
rpt2 = obj2 << Report;
expr2 = rpt2 << Get Journal;
ans = Equal( expr1, expr2 );
Code Explanation:
- Open data_table data
- Set Humid1:PM values.
- Create overlay plot.
- Generate initial report.
- Extract initial journal.
- Set missing value code.
- Redo analysis.
- Generate new report.
- Extract new journal.
- Compare journals.