Chart
Example 1
Summary: Creates a point chart to visualize arrival delays by airline, using the 'Chart' platform in JMP.
Code:
dt = Open("data_table.jmp");
dt << Chart( X( :Airline ), Y( :Arrival Delay ), Y[1] << Point Chart( 1 ) );
Code Explanation:
- Open data table.
- Create chart object.
- Set X axis variable.
- Set Y axis variable.
- Configure Y axis as point chart.
Example 2
Summary: Creates a horizontal chart object with Age as the X-axis variable and N as the Y-axis variable, using the Chart function.
Code:
dt = Open("data_table.jmp");
obj = Chart( X( :Age ), Y( N ) );
Code Explanation:
- Open data table.
- Create horizontal chart object.
- Set X-axis variable to Age.
- Set Y-axis variable to N.
Example 3
Summary: Creates a chart with grouped data, assigning variables for X-axis and Y-axis.
Code:
dt = Open("data_table.jmp");
obj = Chart( Grouping( :sex ), X( :Age ), Y( N ) );
Code Explanation:
- Open data table;
- Create chart object.
- Set grouping variable.
- Assign X-axis variable.
- Assign Y-axis variable.
Example 4
Summary: Creates a point chart to visualize data relationships between 'name' and 'weight', utilizing Chart Builder's configuration options.
Code:
Open("data_table.jmp");
Chart( X( :name ), Y( :weight ), Y[1] << Point Chart( 1 ), connect points( 1 ) );
Code Explanation:
- Open data table;
- Create chart with variables.
- Set X-axis variable.
- Set Y-axis variable.
- Configure Y-axis as point chart.
- Connect data points.
Example 5
Summary: Creates a pie chart from a data table, specifying the X-axis variable as 'Airline' and the Y-axis variable as 'N'.
Code:
dt under test = Open("data_table.jmp");
obj = Chart( X( :Airline ), Y( N( N ) ), Pie Chart( 1 ) );
Code Explanation:
- Open data table;
- Assign dataset to variable.
- Create chart object.
- Set X-axis variable.
- Set Y-axis variable.
- Specify pie chart type.
- Generate pie chart.