Function
Function using New Window
Example 1
Summary: Creates a graph box with a custom Y axis scale, plotting the function -1/x and setting frame size to 200x200.
Code:
Open("data_table.jmp");
tw = New Window( "-1/x",
gb = Graph Box(
Xname( "X(-1/x Scale)" ),
X Scale( .1, 10 ),
Y Scale( -1 / .1, -1. / 10 ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( -1 / x, x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Negative Reciprocal" ) ) << Min( .1 ) << Max( 10 );
Code Explanation:
- Open data table;
- Create new window titled "-1/x".
- Insert graph box.
- Set X axis name to "X(-1/x Scale)".
- Define X axis scale from 0.1 to 10.
- Define Y axis scale from -10 to -0.1.
- Set frame size to 200x200.
- Set pen color to red.
- Plot Y function as -1/x.
- Customize Y axis scale to "Negative Reciprocal".
Example 2
Summary: Creates a graph box with a custom Y-axis scale, plotting the function -1/x and setting frame size to 200x200 pixels.
Code:
dt = Open("data_table.jmp");
tw = New Window( "-1/x",
gb = Graph Box(
Xname( "X(-1/x Scale)" ),
X Scale( .1, 10 ),
Y Scale( -1 / .1, -1. / 10 ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( -1 / x, x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Negative Reciprocal" ) ) << Min( .1 ) << Max( 10 );
tw;
Code Explanation:
- Open data table.
- Create new window.
- Initialize graph box.
- Set X-axis label.
- Define X-axis scale.
- Define Y-axis scale.
- Set frame size.
- Set pen color to red.
- Plot Y function.
- Customize Y-axis scale.
Example 3
Summary: Creates a custom graph with a negative reciprocal squared scale, utilizing Graph Builder to plot Y function -1/x^2.
Code:
Open("data_table.jmp");
tw = New Window( "-1/x^2",
gb = Graph Box(
Xname( "X(-1/x^2 Scale)" ),
X Scale( .1, 10 ),
Y Scale( -1 / (.1 ^ 2), -1. / (10 ^ 2) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( -1 / (x ^ 2), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Negative Reciprocal Squared" ) ) << Min( .1 ) << Max( 10 );
Code Explanation:
- Open data table;
- Create new window titled "-1/x^2".
- Initialize graph box with custom X axis.
- Set X scale from 0.1 to 10.
- Set Y scale from -100 to -0.01.
- Set frame size to 200x200.
- Set pen color to red.
- Plot Y function -1/x^2.
- Modify Y axis to custom scale.
- Set custom scale name "Negative Reciprocal Squared".
Example 4
Summary: Creates a graph box with a custom Y-axis scale, plotting the function -1/x^2 and setting frame size, pen color, and X-axis name.
Code:
dt = Open("data_table.jmp");
tw = New Window( "-1/x^2",
gb = Graph Box(
Xname( "X(-1/x^2 Scale)" ),
X Scale( .1, 10 ),
Y Scale( -1 / (.1 ^ 2), -1. / (10 ^ 2) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( -1 / (x ^ 2), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Negative Reciprocal Squared" ) ) << Min( .1 ) << Max( 10 );
tw;
Code Explanation:
- Open data table.
- Create new window.
- Add graph box.
- Set X-axis name.
- Set X-axis scale.
- Set Y-axis scale.
- Set frame size.
- Set pen color.
- Plot Y function.
- Customize Y-axis scale.
Example 5
Summary: Creates a graph box with a custom Y-axis scale, plotting a function and displaying a frame with a specified size.
Code:
Open("data_table.jmp");
tw = New Window( "Arrhenius C extremely low",
gb = Graph Box(
Xname( "X(Arrhenius C Scale extremely low)" ),
X Scale( -273, -240 ),
Y Scale( -11605 / (-273 + 273.15), -11605 / (-240 + 273.15) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( -11605 / (x + 273.15), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Arrhenius C" ) ) << Min( -273 ) << Max( -240 );
Code Explanation:
- Open data table.
- Create new window.
- Add graph box.
- Set X axis label.
- Define X axis range.
- Calculate Y axis range.
- Set frame size.
- Set pen color.
- Plot Y function.
- Customize Y axis scale.
Example 6
Summary: Creates a graph box with a custom Arrhenius C scale, plotting a Y function and configuring the X-axis and Y-axis scales.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Arrhenius C extremely low",
gb = Graph Box(
Xname( "X(Arrhenius C Scale extremely low)" ),
X Scale( -273, -240 ),
Y Scale( -11605 / (-273 + 273.15), -11605 / (-240 + 273.15) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( -11605 / (x + 273.15), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Arrhenius C" ) ) << Min( -273 ) << Max( -240 );
tw;
Code Explanation:
- Open data table.
- Create new window.
- Initialize graph box.
- Set X-axis name.
- Define X-axis scale range.
- Calculate Y-axis scale range.
- Set frame size.
- Set pen color to red.
- Plot Y function.
- Customize Y-axis scale.
Example 7
Summary: Creates a graph box in JMP, visualizing an Arrhenius function with a custom scale and color scheme.
Code:
Open("data_table.jmp");
tw = New Window( "Arrhenius C room temperature",
gb = Graph Box(
Xname( "X(Arrhenius C Scale room temperature)" ),
X Scale( 0, 100 ),
Y Scale( -11605 / (0 + 273.15), -11605 / (100 + 273.15) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( -11605 / (x + 273.15), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Arrhenius C" ) ) << Min( 0 ) << Max( 100 );
Code Explanation:
- Open data table;
- Create new window titled "Arrhenius C room temperature".
- Add graph box to window.
- Set X-axis name.
- Set X-axis scale from 0 to 100.
- Calculate Y-axis scale limits.
- Set Y-axis scale.
- Set frame size.
- Set pen color to red.
- Plot Arrhenius function on Y-axis.
Example 8
Summary: Creates a graph box with an Arrhenius function, customized Y-axis scale, and specified frame size.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Arrhenius C room temperature",
gb = Graph Box(
Xname( "X(Arrhenius C Scale room temperature)" ),
X Scale( 0, 100 ),
Y Scale( -11605 / (0 + 273.15), -11605 / (100 + 273.15) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( -11605 / (x + 273.15), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Arrhenius C" ) ) << Min( 0 ) << Max( 100 );
tw;
Code Explanation:
- Open data table.
- Create new window.
- Initialize graph box.
- Set X-axis label.
- Define X-axis range.
- Calculate Y-axis range.
- Set graph size.
- Set pen color.
- Plot Arrhenius function.
- Customize Y-axis scale.
Example 9
Summary: Creates a graph box with an Arrhenius F scale, plotting a Y function and customizing the X-axis scale.
Code:
Open("data_table.jmp");
tw = New Window( "Arrhenius F extremely low",
gb = Graph Box(
Xname( "X(Arrhenius F Scale extremely low)" ),
X Scale( -459, -440 ),
Y Scale( -20889. / (-459 + 459.67), -20889. / (-440 + 459.67) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( -20889. / (x + 459.67), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Arrhenius F" ) ) << Min( -459 ) << Max( -440 );
Code Explanation:
- Open data table.
- Create new window.
- Add graph box.
- Set X-axis name.
- Define X-axis scale.
- Calculate Y-axis scale.
- Set frame size.
- Set pen color.
- Plot Y function.
- Customize Y-axis scale.
Example 10
Summary: Creates a graph box with a custom Y-axis scale based on an Arrhenius F formula, while setting frame size and pen color.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Arrhenius F extremely low",
gb = Graph Box(
Xname( "X(Arrhenius F Scale extremely low)" ),
X Scale( -459, -440 ),
Y Scale( -20889. / (-459 + 459.67), -20889. / (-440 + 459.67) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( -20889. / (x + 459.67), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Arrhenius F" ) ) << Min( -459 ) << Max( -440 );
tw;
Code Explanation:
- Open data table.
- Create new window titled "Arrhenius F extremely low".
- Initialize graph box with X-axis name.
- Set X-axis scale from -459 to -440.
- Set Y-axis scale based on formula.
- Define frame size as 200x200.
- Set pen color to red.
- Plot Y function using given formula.
- Customize Y-axis scale to "Arrhenius F".
- Set custom scale minimum and maximum values.
Example 11
Summary: Creates a graph box in JMP, visualizing an Arrhenius F scale room temperature plot with a custom Y-axis scale.
Code:
Open("data_table.jmp");
tw = New Window( "Arrhenius F room temperature",
gb = Graph Box(
Xname( "X(Arrhenius F Scale room temperature)" ),
X Scale( 0, 100 ),
Y Scale( -20889. / (0 + 459.67), -20889. / (100 + 459.67) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( -20889. / (x + 459.67), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Arrhenius F" ) ) << Min( 0 ) << Max( 100 );
Code Explanation:
- Open data table.
- Create new window titled "Arrhenius F room temperature".
- Initialize graph box.
- Set X-axis name.
- Define X-axis scale range.
- Calculate Y-axis scale range.
- Set graph size.
- Set pen color to red.
- Plot Y function.
- Customize Y-axis scale.
Example 12
Summary: Creates a graph box in JMP, visualizing Arrhenius F scale room temperature data with a custom Y-axis scale.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Arrhenius F room temperature",
gb = Graph Box(
Xname( "X(Arrhenius F Scale room temperature)" ),
X Scale( 0, 100 ),
Y Scale( -20889. / (0 + 459.67), -20889. / (100 + 459.67) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( -20889. / (x + 459.67), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Arrhenius F" ) ) << Min( 0 ) << Max( 100 );
tw;
Code Explanation:
- Open data table;
- Create new window titled "Arrhenius F room temperature".
- Insert graph box.
- Set X-axis name.
- Set X-axis scale from 0 to 100.
- Set Y-axis scale based on Arrhenius formula.
- Set frame size to 200x200.
- Set pen color to red.
- Plot Arrhenius function on Y-axis.
- Customize Y-axis scale to "Arrhenius F".
Example 13
Summary: Creates a Weibull quantile graph with customized X-axis and Y-axis scales, using JMP's Graph Builder platform.
Code:
Open("data_table.jmp");
tw = New Window( "Exp Prob",
gb = Graph Box(
Xname( "X(Exp Prob Scale)" ),
X Scale( .001, .999 ),
Y Scale( Weibull Quantile( .001, 1 ), Weibull Quantile( .999, 1 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( Weibull Quantile( x, 1 ), x );
)
);
gb[axisbox( 2 )] << scale( "Exp Prob" ) << Min( .001 ) << Max( .999 );
Code Explanation:
- Open data table;
- Create new window titled "Exp Prob".
- Add graph box to window.
- Set X-axis name.
- Define X-axis scale range.
- Define Y-axis scale using Weibull quantile.
- Set frame size.
- Set pen color to red.
- Plot Weibull function on graph.
- Customize Y-axis to "Exp Prob" scale.
Example 14
Summary: Creates a graph box in JMP, visualizing Weibull Quantile function with customized X and Y scales.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Exp Prob",
gb = Graph Box(
Xname( "X(Exp Prob Scale)" ),
X Scale( .001, .999 ),
Y Scale( Weibull Quantile( .001, 1 ), Weibull Quantile( .999, 1 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( Weibull Quantile( x, 1 ), x );
)
);
gb[axisbox( 2 )] << scale( "Exp Prob" ) << Min( .001 ) << Max( .999 );
tw;
Code Explanation:
- Open data table.
- Create new window.
- Add graph box.
- Set X axis name.
- Set X axis scale.
- Set Y axis scale using Weibull Quantile.
- Set frame size.
- Set pen color to red.
- Plot Weibull Quantile function.
- Customize Y axis scale to Exp Prob.
Example 15
Summary: Creates a graph box in JMP, visualizing Frechet probability distribution with customized X and Y scales.
Code:
Open("data_table.jmp");
tw = New Window( "Frechet Prob",
gb = Graph Box(
Xname( "X(Frechet Prob Scale)" ),
X Scale( .001, .999 ),
Y Scale( LEV Quantile( .001, 0, 1 ), LEV Quantile( .999, 0, 1 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( LEV Quantile( x, 0, 1 ), x );
)
);
gb[axisbox( 2 )] << scale( "Frechet Prob" ) << Min( .001 ) << Max( .999 );
Code Explanation:
- Open data table;
- Create new window titled "Frechet Prob".
- Add graph box to window.
- Set X axis name and scale.
- Set Y axis scale using LEV Quantile.
- Set graph size.
- Change pen color to red.
- Plot Y function using LEV Quantile.
- Access second axis box.
- Set axis scale, min, and max.
Example 16
Summary: Creates a graph box in JMP, visualizing Frechet probability distribution with customized X and Y scales.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Frechet Prob",
gb = Graph Box(
Xname( "X(Frechet Prob Scale)" ),
X Scale( .001, .999 ),
Y Scale( LEV Quantile( .001, 0, 1 ), LEV Quantile( .999, 0, 1 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( LEV Quantile( x, 0, 1 ), x );
)
);
gb[axisbox( 2 )] << scale( "Frechet Prob" ) << Min( .001 ) << Max( .999 );
tw;
Code Explanation:
- Open data table.
- Create new window named "Frechet Prob".
- Initialize graph box.
- Set X-axis name.
- Define X-axis scale.
- Define Y-axis scale using LEV Quantile.
- Set frame size.
- Set pen color to red.
- Plot Y function using LEV Quantile.
- Customize axis settings for Y-axis.
Example 17
Summary: Creates a logarithmic graph with a custom scale, plotting natural log function and setting frame size to 200x200.
Code:
Open("data_table.jmp");
tw = New Window( "Ln",
gb = Graph Box(
Xname( "X(Ln Scale)" ),
X Scale( .1, 10 ),
Y Scale( Log( .1 ), Log( 10 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( Log( x ), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Ln" ) ) << Min( .1 ) << Max( 10 );
Code Explanation:
- Open data table.
- Create new window named "Ln".
- Insert graph box.
- Set X-axis name to "X(Ln Scale)".
- Set X-axis scale from 0.1 to 10.
- Set Y-axis scale logarithmic.
- Set frame size to 200x200.
- Set pen color to red.
- Plot natural log function on Y-axis.
- Customize Y-axis scale to logarithmic.
Example 18
Summary: Creates a logarithmic graph with custom scaling, utilizing Graph Builder to plot Y function as log(x) and customize the Y axis scale.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Ln",
gb = Graph Box(
Xname( "X(Ln Scale)" ),
X Scale( .1, 10 ),
Y Scale( Log( .1 ), Log( 10 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( Log( x ), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Ln" ) ) << Min( .1 ) << Max( 10 );
tw;
Code Explanation:
- Open data table.
- Create new window titled "Ln".
- Add graph box to window.
- Set X axis name to "X(Ln Scale)".
- Set X axis scale from 0.1 to 10.
- Set Y axis scale logarithmic from 0.1 to 10.
- Set graph size to 200x200.
- Set pen color to red.
- Plot Y function as log(x).
- Customize Y axis scale to logarithmic.
Example 19
Summary: Creates a graph box in JMP, plotting the log2 function on the Y-axis with customized X-axis scale and color.
Code:
Open("data_table.jmp");
tw = New Window( "Log2",
gb = Graph Box(
Xname( "X(Log2 Scale)" ),
X Scale( 2 ^ (-10), 2 ^ (10) ),
Y Scale( -10, 10 ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( Log( x, 2 ), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "log2" ) ) << Min( 2 ^ (-10) ) << Max( 2 ^ (10) );
Code Explanation:
- Open data table;
- Create new window titled "Log2".
- Add graph box to window.
- Set X-axis label to "X(Log2 Scale)".
- Set X-axis scale from 2^-10 to 2^10.
- Set Y-axis scale from -10 to 10.
- Set graph size to 200x200.
- Set pen color to red.
- Plot log2 function on Y-axis.
- Customize X-axis scale to log2.
Example 20
Summary: Creates a graph box with log2 scale in JMP, customizing X-axis and Y-axis scales for visualization.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Log2",
gb = Graph Box(
Xname( "X(Log2 Scale)" ),
X Scale( 2 ^ (-10), 2 ^ (10) ),
Y Scale( -10, 10 ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( Log( x, 2 ), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "log2" ) ) << Min( 2 ^ (-10) ) << Max( 2 ^ (10) );
tw;
Code Explanation:
- Open data table;
- Create new window titled "Log2".
- Add graph box to window.
- Set X-axis name to "X(Log2 Scale)".
- Set X-axis scale from 2^-10 to 2^10.
- Set Y-axis scale from -10 to 10.
- Set graph frame size to 200x200.
- Set pen color to red.
- Plot Y function as log base 2 of X.
- Customize X-axis scale to log2.
Example 21
Summary: Vizualizes logistic probability distribution with a custom graph box, utilizing X-axis scaling and Y-axis quantiles.
Code:
Open("data_table.jmp");
tw = New Window( "Logistic Prob",
gb = Graph Box(
Xname( "X(Logistic Prob Scale)" ),
X Scale( .001, .999 ),
Y Scale( Logistic Quantile( .001, 0, 1 ), Logistic Quantile( .999, 0, 1 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( Logistic Quantile( x, 0, 1 ), x );
)
);
gb[axisbox( 2 )] << scale( "Logistic Prob" ) << Min( .001 ) << Max( .999 );
Code Explanation:
- Open data table;
- Create new window titled "Logistic Prob".
- Add graph box to window.
- Set X-axis name.
- Define X-axis scale range.
- Define Y-axis scale using logistic quantiles.
- Set graph size.
- Set pen color to red.
- Plot logistic function on Y-axis.
- Customize Y-axis scale to logistic probability.
Example 22
Summary: Vizualizes logistic probability scales in a new window, utilizing Graph Builder to plot the logistic function and customize the Y axis scale.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Logistic Prob",
gb = Graph Box(
Xname( "X(Logistic Prob Scale)" ),
X Scale( .001, .999 ),
Y Scale( Logistic Quantile( .001, 0, 1 ), Logistic Quantile( .999, 0, 1 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( Logistic Quantile( x, 0, 1 ), x );
)
);
gb[axisbox( 2 )] << scale( "Logistic Prob" ) << Min( .001 ) << Max( .999 );
tw;
Code Explanation:
- Open data table.
- Create new window.
- Add graph box.
- Set X axis name.
- Set X axis scale.
- Set Y axis scale using logistic quantile.
- Set frame size.
- Set pen color to red.
- Plot logistic function on Y axis.
- Customize Y axis scale to logistic probability.
Example 23
Summary: Creates a normal probability graph, visualizing the distribution of data points with a red pen color and customized Y axis scale.
Code:
Open("data_table.jmp");
tw = New Window( "Normal Prob",
gb = Graph Box(
Xname( "X(Normal Prob Scale)" ),
X Scale( .001, .999 ),
Y Scale( Normal Quantile( .001 ), Normal Quantile( .999 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( Normal Quantile( x ), x );
)
);
gb[axisbox( 2 )] << scale( "Normal" ) << Min( .001 ) << Max( .999 );
Code Explanation:
- Open data table.
- Create new window titled "Normal Prob".
- Add graph box to window.
- Set X axis name.
- Define X axis scale.
- Define Y axis scale using normal quantiles.
- Set graph frame size.
- Set pen color to red.
- Plot normal quantile function on Y axis.
- Customize Y axis scale to normal distribution.
Example 24
Summary: Creates a normal probability plot with interactive scaling and axis labels, utilizing Graph Builder to visualize the distribution.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Normal Prob",
gb = Graph Box(
Xname( "X(Normal Prob Scale)" ),
X Scale( .001, .999 ),
Y Scale( Normal Quantile( .001 ), Normal Quantile( .999 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( Normal Quantile( x ), x );
)
);
gb[axisbox( 2 )] << scale( "Normal" ) << Min( .001 ) << Max( .999 );
tw;
Code Explanation:
- Open data table.
- Create new window.
- Initialize graph box.
- Set X-axis name.
- Define X-axis scale.
- Set Y-axis scale using normal quantiles.
- Set frame size.
- Change pen color to red.
- Plot normal quantile function.
- Adjust Y-axis to normal scale.
Example 25
Summary: Creates a graph with a square root scale, visualizing the relationship between X and Y variables in a custom window.
Code:
Open("data_table.jmp");
tw = New Window( "Sqrt",
gb = Graph Box(
Xname( "X(Sqrt Scale)" ),
X Scale( .01, 10 ),
Y Scale( Sqrt( .01 ), Sqrt( 10 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( Sqrt( x ), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Sqrt" ) ) << Min( .01 ) << Max( 10 );
Code Explanation:
- Open data table.
- Create new window titled "Sqrt".
- Add graph box to window.
- Set X axis name to "X(Sqrt Scale)".
- Define X scale range from 0.01 to 10.
- Define Y scale as square root of X range.
- Set graph size to 200x200.
- Set pen color to red.
- Plot Y function as square root of X.
- Customize Y axis scale to "custom scale".
Example 26
Summary: Creates a graph with a custom Y-axis scale named 'Sqrt' in JMP, using the Graph Builder platform.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Sqrt",
gb = Graph Box(
Xname( "X(Sqrt Scale)" ),
X Scale( .01, 10 ),
Y Scale( Sqrt( .01 ), Sqrt( 10 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( Sqrt( x ), x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Sqrt" ) ) << Min( .01 ) << Max( 10 );
tw;
Code Explanation:
- Open data table.
- Create new window named "Sqrt".
- Add graph box to window.
- Set X-axis name to "X(Sqrt Scale)".
- Set X-axis scale from 0.01 to 10.
- Set Y-axis scale to square root of X-axis range.
- Set graph size to 200x200.
- Set pen color to red.
- Plot Y function as square root of X.
- Customize Y-axis to use custom scale named "Sqrt".
Example 27
Summary: Creates a graph box in JMP, visualizing the squared scale of X-axis values with a custom Y-scale and pen color.
Code:
Open("data_table.jmp");
tw = New Window( "Squared",
gb = Graph Box(
Xname( "X(Squared Scale)" ),
X Scale( .01, 10 ),
Y Scale( .01 ^ 2, 10 ^ 2 ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( x ^ 2, x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Squared" ) ) << Min( .01 ) << Max( 10 );
Code Explanation:
- Open data table.
- Create new window named "Squared".
- Add graph box to window.
- Set X axis name to "X(Squared Scale)".
- Set X axis scale from 0.01 to 10.
- Set Y axis scale from 0.0001 to 100.
- Set frame size to 200x200.
- Set pen color to red.
- Plot Y function as x squared.
- Customize Y axis scale to "custom scale".
Example 28
Summary: Creates a graph with a squared scale, plotting y = x^2 function in JMP.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Squared",
gb = Graph Box(
Xname( "X(Squared Scale)" ),
X Scale( .01, 10 ),
Y Scale( .01 ^ 2, 10 ^ 2 ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( x ^ 2, x );
)
);
gb[axisbox( 2 )] << scale( "custom scale", custom scale name( "Squared" ) ) << Min( .01 ) << Max( 10 );
tw;
Code Explanation:
- Open data table;
- Create new window titled "Squared".
- Initialize graph box with squared scale.
- Set X-axis scale from 0.01 to 10.
- Set Y-axis scale from 0.0001 to 100.
- Define frame size for graph.
- Set pen color to red.
- Plot y = x^2 function.
- Customize Y-axis scale to "custom scale".
- Name custom scale "Squared".
Example 29
Summary: Creates a Weibull probability plot with customized X-axis and Y-axis scales, using Graph Builder to visualize the distribution.
Code:
Open("data_table.jmp");
tw = New Window( "Weibull Prob",
gb = Graph Box(
Xname( "X(Weibull Prob Scale)" ),
X Scale( .001, .999 ),
Y Scale( SEV Quantile( .001, 0, 1 ), SEV Quantile( .999, 0, 1 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( SEV Quantile( x, 0, 1 ), x );
)
);
gb[axisbox( 2 )] << scale( "Weibull Prob" ) << Min( .001 ) << Max( .999 );
Code Explanation:
- Open data table;
- Create new window named "Weibull Prob".
- Initialize graph box.
- Set X-axis name to "Weibull Prob Scale".
- Define X-axis scale range.
- Define Y-axis scale using SEV Quantile function.
- Set frame size to 200x200.
- Set pen color to red.
- Plot Y function using SEV Quantile.
- Configure Y-axis to "Weibull Prob" scale.
Example 30
Summary: Creates a Weibull probability graph with customized X and Y scales, frame size, and pen color.
Code:
dt = Open("data_table.jmp");
tw = New Window( "Weibull Prob",
gb = Graph Box(
Xname( "X(Weibull Prob Scale)" ),
X Scale( .001, .999 ),
Y Scale( SEV Quantile( .001, 0, 1 ), SEV Quantile( .999, 0, 1 ) ),
Framesize( 200, 200 ),
Pen Color( "red" );
Y Function( SEV Quantile( x, 0, 1 ), x );
)
);
gb[axisbox( 2 )] << scale( "Weibull Prob" ) << Min( .001 ) << Max( .999 );
tw;
Code Explanation:
- Open data table.
- Create new window titled "Weibull Prob".
- Add graph box to window.
- Set X axis name.
- Define X scale range.
- Set Y scale using SEV Quantile.
- Set frame size.
- Change pen color to red.
- Plot Y function using SEV Quantile.
- Set second axis scale to "Weibull Prob".
- Define axis minimum value.
- Define axis maximum value.
- Display the window.
Function using With Window Handler
Example 1
Summary: Creates a Fit Y by X window with a custom window handler function, setting the margin to 50 and displaying the current margin.
Code:
dt = Open("data_table.jmp");
With Window Handler(
dt << Fit Y By X(),
Function( {w},
w << Margin( 50 );
Show( w << Get Margin );
)
);
Code Explanation:
- Open data table;
- Create Fit Y by X window.
- Define window handler function.
- Set window margin to 50.
- Display current window margin.
Example 2
Summary: Fits Y by X analysis, setting window margins, and running a Bivariate script to generate reports.
Code:
dt = Open("data_table.jmp");
With Window Handler(
dt << Fit Y By X(),
Function( {w},
w << Margin( 50 );
Show( w << Get Margin );
)
);
dt = Open("data_table.jmp");
biv = dt << Run Script( "Bivariate" );
(biv << TopReport) << Margin( 50 );
(biv << TopReport) << Get Margin;
Code Explanation:
- Open data_table data
- Create window handler.
- Fit Y by X analysis.
- Set window margin to 50.
- Show window margin.
- Reopen data_table data.
- Run Bivariate script.
- Set report margin to 50.
- Get report margin.
Example 3
Summary: Runs data analysis and visualization by opening a data table, fitting Y by X, setting window margins, and displaying the top report of a Bivariate script.
Code:
dt = Open("data_table.jmp");
With Window Handler(
dt << Fit Y By X(),
Function( {w},
w << Margin( 50 );
Show( w << Get Margin );
)
);
dt = Open("data_table.jmp");
biv = dt << Run Script( "Bivariate" );
(biv << TopReport) << Margin( 50 );
Code Explanation:
- Open data table.
- Create Fit Y By X analysis.
- Set window handler function.
- Adjust window margin to 50.
- Display current window margin.
- Reopen data table.
- Run Bivariate script.
- Access top report of Bivariate.
- Set margin to 50 for Bivariate report.
Example 1
Summary: Runs the renaming process for a JMP data table, printing the old and new names, and subscribing/unsubscribing to rename events.
Code:
dt = Open("data_table.jmp");
dname = dt << get name;
f = Function( {dtab, tabname},
Print( "oldname", dname );
Print( "new name", dtab << get name );
);
dt << Subscribe( "name1", On Rename( f ) );
dt << set name( "Best Class" );
dt << unsubscribe( "name1", onRename );
dt << set name( "Rowdy Class" );
Code Explanation:
- Open data table;
- Get table's original name.
- Define a function to print names.
- Subscribe to rename event.
- Change table name to "Best Class".
- Unsubscribe from rename event.
- Change table name to "Rowdy Class".
Example 2
Summary: Runs the renaming of a data table and triggers a Distribution script upon rename, utilizing JMP's Subscribe feature.
Code:
dt = Open("data_table.jmp");
dname = dt << get name;
f = Function( {dtab, tabname},
Print( "oldname", dname );
Print( "new name", dtab << get name );
);
dt << Subscribe( "test1", On Rename( f ) );
dt << set name( "Best Class" );
dt << Run Script( "Distribution" );
dt << unsubscribe( "test1", onRename );
dt << set name( "Better Class" );
Code Explanation:
- Open data table;
- Get table's original name.
- Define a function for renaming.
- Subscribe to rename event.
- Rename table to "Best Class".
- Run Distribution script.
- Unsubscribe from rename event.
- Rename table to "Better Class".
Example 3
Summary: Runs various data table operations, including adding and deleting rows and columns, renaming columns, and saving the table.
Code:
dt = Open("data_table.jmp");
addRowsFn = Function( {},
Print( "hello add row" )
);
dt << subscribe( "Test Add", onAddRows( addRowsFn, 3 ) );
deleteRowsFn = Function( {},
Print( "hello delete row" )
);
dt << subscribe( "Test Delete", onDeleteRows( deleteRowsFn, 3 ) );
addColsFn = Function( {},
Print( "hello add column" )
);
dt << subscribe( "Test Add", onAddColumns( addColsFn, 2 ) );
deleteColsFn = Function( {},
Print( "hello delete col" )
);
dt << subscribe( "Test Delete", onDeleteCols( deleteColsFn, 2 ) );
renameColsFn = Function( {},
Print( "hello rename column" )
);
dt << subscribe( "Test Rename", onRenameColumns( renameColsFn, 3 ) );
saveFn = Function( {},
Print( "hello save" )
);
dt << subscribe( "Test Save", onSave( saveFn, 3 ) );
closeFn = Function( {},
Print( "hello close" )
);
Code Explanation:
- Open data table.
- Define function for adding rows.
- Subscribe to add rows event.
- Define function for deleting rows.
- Subscribe to delete rows event.
- Define function for adding columns.
- Subscribe to add columns event.
- Define function for deleting columns.
- Subscribe to delete columns event.
- Define function for renaming columns.
- Subscribe to rename columns event.
- Define function for saving table.
- Subscribe to save event.
- Define function for closing table.
Example 4
Summary: Opens a data table and subscribing to the 'CrashySub' event upon table open, with an additional function triggered on add columns.
Code:
dt2 = Open("data_table.jmp");
on tbl open = Function( {dt2},
dt2 << Subscribe( "CrashySub", On Add Columns( Function( {d2t, cols}, . ) ) )
);
Code Explanation:
- Open data table.
- Define function on table open.
- Subscribe to "CrashySub" event.
- Define function on add columns.
- Capture added columns in
cols. - Execute empty function body.