Preferences
Summary: Sets platform preferences and defines MATLAB installation paths for a seamless integration with JMP.
Code:
//
// Change me to the PATH and name of your MATLAB installation.
Preferences(
PathVar(
MATLABROOT32(
"C:\Program Files (x86)\MATLAB\R2013a"
),
MATLABROOT(
"C:\Program Files\MATLAB\R2013a"
)
)
);
//Test out the connection, returns 0 if successful.
/*MATLAB Init();
MATLAB Term ();*/;
Code Explanation:
- Set platform preferences.
- Define MATLABROOT32 path.
- Define MATLABROOT path.
- Assign MATLAB installation paths.
Example 1
Summary: This JSL script adds two color themes to the JMP platform, defining 'Seaborn' as a qualitative theme with 10 colors and 'Seaborn Blues' as a sequential theme with 6 colors.
Code:
//
Preferences(
Add Color Theme(
{"Seaborn", {"Qualitative"}, {{76,
114, 176}, {221, 132, 82}, {85,
168, 104}, {196, 78, 82}, {129,
114, 179}, {147, 120, 96}, {218,
139, 195}, {140, 140, 140}, {204,
185, 116}, {100, 181, 205}}}
),
Add Color Theme(
{"Seaborn Blues", {"Sequential"},
{{218, 232, 245}, {186, 214, 234},
{136, 190, 220}, {83, 157, 204},
{42, 122, 185}, {11, 85, 159}}}
)
);
Code Explanation:
- Preferences command begins.
- Adds "Seaborn" color theme.
- Defines "Qualitative" color type.
- Lists 10 color codes.
- Adds "Seaborn Blues" color theme.
- Defines "Sequential" color type.
- Lists 6 color codes.
- Preferences command ends.
Example 2
Summary: This script sets default names, enables header statistics display, forces character statistics display, and opens a data table in JMP.
Code:
Names Default To Here( 1 );
Preferences( (Header Stats( Show( 1 ), Force Char Stats( 1 ) )), Set( Enable Experimental Data Table GUI( 1 ) ) );
dat1 = Open("data_table.jmp");
Code Explanation:
- Set default names to current script.
- Enable header statistics display.
- Force character statistics display.
- Enable experimental data table GUI.
- Open data table;
Example 3
Summary: This script sets default names scope, defines color constants, and configures summary graph preferences. It then opens a data table and selects each row in the first 49 rows.
Code:
Names Default To Here( 1 );
c = 0.9;
Preferences(
Show Summary Graphs Below Column Names( 1 ),
Summary Graph Continuous Color( RGB Color( c, 0, 0 ) ),
Summary Graph Continuous Missing Color( RGB Color( 0, 0, c ) ),
Summary Graph Size Ordered Color( RGB Color( 0, c, 0 ) ),
Summary Graph Name Ordered Color( RGB Color( 0, c, c ) ),
Summary Graph Other Color( RGB Color( c, c, 0 ) ),
);
Open("data_table.jmp");
For( i = 1, i < 50, i++,
Row State( i ) = Selected State( 1 )
);
Code Explanation:
- Set default names scope.
- Define color constant.
- Set preferences for summary graphs.
- Open data table;
- Loop through first 49 rows.
- Select each row.
Example 4
Summary: Sets preferences for summary graphs, defines color variables, and opens a data table. It then selects the first 49 rows.
Code:
Names Default To Here( 1 );
c = 0.9;
d = 0.5;
Preferences(
Show Summary Graphs Below Column Names( 1 ),
Summary Graph Continuous Color( RGB Color( c, 0, 0 ) ),
Summary Graph Continuous Missing Color( RGB Color( 0, 0, c ) ),
Summary Graph Size Ordered Color( RGB Color( 0, c, 0 ) ),
Summary Graph Name Ordered Color( RGB Color( 0, c, c ) ),
Summary Graph Other Color( RGB Color( c, c, 0 ) ),
Summary Graph Continuous Highlight Color( RGB Color( d, 0, 0 ) ),
Summary Graph Continuous Missing Highlight Color( RGB Color( 0, 0, d ) ),
Summary Graph Size Ordered Highlight Color( RGB Color( 0, d, 0 ) ),
Summary Graph Name Ordered Highlight Color( RGB Color( 0, d, d ) ),
Summary Graph Other Highlight Color( RGB Color( d, d, 0 ) ),
);
Open("data_table.jmp");
For( i = 1, i < 50, i++,
Row State( i ) = Selected State( 1 )
);
Code Explanation:
- Set default names.
- Define color variable c.
- Define color variable d.
- Set preferences for summary graphs.
- Set continuous color for summary graphs.
- Set continuous missing color for summary graphs.
- Set size ordered color for summary graphs.
- Set name ordered color for summary graphs.
- Set other color for summary graphs.
- Set continuous highlight color for summary graphs.
- Set continuous missing highlight color for summary graphs.
- Set size ordered highlight color for summary graphs.
- Set name ordered highlight color for summary graphs.
- Set other highlight color for summary graphs.
- Open data table.
- Select first 49 rows.
Example 5
Summary: This script sets default names and configures summary graphs in JMP, specifying colors for continuous, missing, size-ordered, name-ordered, and other data points. It then opens a data table.
Code:
Names Default To Here( 1 );
Preferences(
Show Summary Graphs Below Column Names( 1 ),
Summary Graph Continuous Color( 37 ),
Summary Graph Continuous Missing Color( 41 ),
Summary Graph Size Ordered Color( 35 ),
Summary Graph Name Ordered Color( 36 ),
Summary Graph Other Color( 70 ),
Summary Graph Continuous Highlight Color( 151 ),
Summary Graph Continuous Missing Highlight Color( 153 ),
Summary Graph Size Ordered Highlight Color( 155 ),
Summary Graph Name Ordered Highlight Color( 157 ),
Summary Graph Other Highlight Color( 159 ),
);
Open("data_table.jmp");
Code Explanation:
- Set default names.
- Configure summary graphs.
- Set continuous color.
- Set missing color.
- Set size ordered color.
- Set name ordered color.
- Set other color.
- Set continuous highlight color.
- Set missing highlight color.
- Set size ordered highlight color.
- Set name ordered highlight color.
- Set other highlight color.
- Open data table.
Example 6
Summary: This script sets default name scope, configures summary graph preferences, and opens a data table in JMP. It enables the display of summary graphs below column names, specifies mosaic and run chart types for categorical and continuous variables respectively, and defines custom colors for these graphs.
Code:
Names Default To Here( 1 );
Preferences(
Show Summary Graphs Below Column Names( 1 ),
Categorical graph type( "Mosaic" ),
Continuous graph type( "Run Chart" ),
Summary Graph Run Chart Color( "medium light orange" ),
Summary Graph Other Color( "Medium Light Green" ),
);
dt = Open("data_table.jmp");
Code Explanation:
- Set default name scope.
- Configure summary graphs preferences.
- Open data table;
Example 7
Summary: This script sets default name scope, configures preferences for graph types and colors, opens a data table, and resizes the window to optimize visualization.
Code:
Names Default To Here( 1 );
Preferences(
Show Summary Graphs Below Column Names( 1 ),
Categorical graph type( "Run Chart" ),
Continuous graph type( "Heat Map" ),
Summary Graph Run Chart Color( "medium light red" ),
);
dt = Open("data_table.jmp");
dt << set window size( 800, 500 );
Code Explanation:
- Set default name scope.
- Configure preferences.
- Open data table.
- Resize data table window.
Example 8
Summary: Opens a data table and sets preferences to default.
Code:
dat1 = Open("data_table.jmp");
Preferences( Factory Default );
Code Explanation:
- Open data table.
- Set preferences to default.
Set Preferences
Summary: Sets preferences for JMP, customizing table and graph visualizations to enhance data exploration.
Code:
//
Set Preferences(
Underline Table Headings( 0 ),
Shade Table Headings( 0 ),
Table Heading Column Borders( 0 ),
Table Column Borders( 0 ),
Table Column Group Borders( 1 ),
Table Row Borders( 0 ),
Shade Alternate Table Rows( 0 ),
Shade Table Cells( 0 ),
Interactive HTML Color(
"Light Background"
),
Graph Marker size( "XL" ),
Graph Marker( "Dot" ),
Graph Marker Theme( "Standard" ),
Marker Selection Mode(
"Unselected Faded"
),
Marker Label Color Style(
"Marker Color"
),
Add Color Theme(
{"Seaborn", 8193, {{76, 114, 176},
{221, 132, 82}, {85, 168, 104},
{196, 78, 82}, {129, 114, 179},
{147, 120, 96}, {218, 139, 195},
{140, 140, 140}, {204, 185, 116},
{100, 181, 205}}}
),
Add Color Theme(
{"Seaborn Blues", 2051, {{218,
232, 245}, {186, 214, 234}, {136,
190, 220}, {83, 157, 204}, {42,
122, 185}, {11, 85, 159}}}
),
Continuous Color Theme(
{"Seaborn Blues", 2051, {{218,
232, 245}, {186, 214, 234}, {136,
190, 220}, {83, 157, 204}, {42,
122, 185}, {11, 85, 159}}}
),
Categorical Color Theme(
{"Seaborn", 8193, {{76, 114, 176},
{221, 132, 82}, {85, 168, 104},
{196, 78, 82}, {129, 114, 179},
{147, 120, 96}, {218, 139, 195},
{140, 140, 140}, {204, 185, 116},
{100, 181, 205}}}
),
Graph Height( 350 ),
Fill Selection Mode(
"Selected Patterned"
),
Fill Selection Color( 3 ),
Graph Border( 0 ),
Frame Border( 0 ),
Inside Ticks( 0 ),
Major Grid Lines( 1 ),
Minor Grid Lines( 0 ),
Line Width( 3 ),
Axis Title Above( 0 ),
Hide Overlapping Labels( 1 ),
Major Grid Line Color( 2 ),
Minor Grid Line Color( 32 ),
Frame Color( 2 ),
Background Color( -16777215 ),
Graph Background Color( -15395570 ),
Histogram Color( {187, 219, 251} )
);
Code Explanation:
- Set preferences for JMP.
- Disable table heading underline.
- Disable table heading shading.
- Disable table column borders.
- Enable table column group borders.
- Disable table row borders.
- Disable alternate row shading.
- Disable cell shading.
- Set interactive HTML color.
- Set graph marker size.
Get Preferences
Summary: Process of opening a data table, running a logistic script, and restoring user preferences.
Code:
fn = "c:\temp\test.htm";
Usr_Preference = Get Preferences();
Preferences( Axis Title Above( 1 ) );
dt under test = Open("data_table.jmp");
obj = dt under test << run script( "Logistic" );
Usr_Preference;
Code Explanation:
- Define file path.
- Save user preferences.
- Set axis title above.
- Open data table.
- Run logistic script.
- Restore user preferences.
Preferences using Add Column Properties
Summary: Configures data table properties, including adding Link ID and Link Reference columns, retrieving column properties, and disabling virtual join auto-open and linked column name usage.
Code:
dt1 = Open("data_table.jmp");
dt1:Person << Add Column Properties( Set Property( "Link ID", 1 ) );
dt2 = Open("data_table.jmp");
dt2:Person << Add Column Properties( Set Property( "Link Reference", Reference Table( dt1 ) ) );
prefs1 = dt1:Person << Get column properties();
Preferences( Virtual Join Auto Open Linked table( 0 ), Virtual Join Use Linked Column Name( 0 ) );
Code Explanation:
- Open data table.
- Add Link ID property to Person column.
- Open data table.
- Add Link Reference property to Person column.
- Retrieve Person column properties.
- Disable auto-open linked tables.
- Disable using linked column names.
Pref
Example 1
Summary: Creates and formats new columns in a JMP data table, utilizing thousands separators for specific columns.
Code:
dt = Open("data_table.jmp");
Pref( Use thousands separator( 0 ) );
dt << New Column( "Column 6", Numeric, continuous, Formula( :height * 10000 ) );
no_sep = Char( :Column 6 << Get Format() );
dt:Column 6 << Format( "Best", Use Thousands Separator, 10 );
yes_sep = Char( :Column 6 << Get Format() );
Pref( Use thousands separator( 1 ) );
dt << New Column( "Column 7", Numeric, continuous, Formula( :height * 10000 ) );
no12_sep = Char( :Column 7 << Get Format() );
dt:Column 7 << Format( "Best", Use Thousands Separator( 0 ), 10 );
yes0_sep = Char( :Column 7 << Get Format() );
current preferences = Get Preferences();
Close( dt, nosave );
initial preferences = Get Preferences();
initial pref = Get Preferences( Use thousands separator );
Code Explanation:
- Open data table.
- Disable thousands separator.
- Create new column "Column 6".
- Get format of "Column 6".
- Set format for "Column 6" with separator.
- Get format of "Column 6" again.
- Enable thousands separator.
- Create new column "Column 7".
- Get format of "Column 7".
- Set format for "Column 7" without separator.
- Get format of "Column 7" again.
- Save current preferences.
- Close data table without saving.
- Save initial preferences.
- Get initial preference for thousands separator.
Example 2
Summary: Creates and formats new columns in a JMP data table, utilizing formulas and thousands separators.
Code:
dt = Open("data_table.jmp");
Pref( Use thousands separator( 0 ) );
dt << New Column( "Column 6", Numeric, continuous, Formula( :height * 10000 ) );
no_sep = Char( :Column 6 << Get Format() );
dt:Column 6 << Format( "Best", Use Thousands Separator, 10 );
yes_sep = Char( :Column 6 << Get Format() );
Pref( Use thousands separator( 1 ) );
dt << New Column( "Column 7", Numeric, continuous, Formula( :height * 10000 ) );
no12_sep = Char( :Column 7 << Get Format() );
dt:Column 7 << Format( "Best", Use Thousands Separator( 0 ), 10 );
yes0_sep = Char( :Column 7 << Get Format() );
current preferences = Get Preferences();
Code Explanation:
- Open data table;
- Disable thousands separator.
- Create new column "Column 6".
- Set formula for "Column 6".
- Get format of "Column 6".
- Format "Column 6" with thousands separator.
- Get updated format of "Column 6".
- Enable thousands separator.
- Create new column "Column 7".
- Set formula for "Column 7".
- Get format of "Column 7".
- Format "Column 7" without thousands separator.
- Get updated format of "Column 7".
- Retrieve current preferences.
Preferences using Char
Example 1
Summary: Formats and retrieves column formats in a JMP data table, including disabling and re-enabling thousands separators.
Code:
dt = Open("data_table.jmp");
f = Char( Column( "sales($M)" ) << Get Format );
f = Char( Column( "#Employees" ) << Get Format );
Pref( Use thousands separator( 0 ) );
Column( "sales($M)" ) << Format( "use thousands separator" );
Column( "#Employees" ) << Format( "use thousands separator" );
f = Char( Column( "sales($M)" ) << Get Format );
f = Char( Column( "#Employees" ) << Get Format );
post pref = Get Preferences( Use thousands separator );
current preferences = Get Preferences();
Close( dt, nosave );
initial preferences = Get Preferences();
Preferences( Factory Default );
default preferences = Get Preferences();
Preferences( Data Filter Select Check( 1 ), Data Filter Show Check( 0 ), Data Filter Include Check( 0 ) );
now prefs = Get Preferences();
Code Explanation:
- Open data table;
- Retrieve sales($M) column format.
- Retrieve #Employees column format.
- Disable thousands separator preference.
- Apply thousands separator to sales($M).
- Apply thousands separator to #Employees.
- Retrieve updated sales($M) format.
- Retrieve updated #Employees format.
- Get post-pref use thousands separator.
- Get current preferences.
- Close dataset without saving.
- Get initial preferences.
- Set factory default preferences.
- Get default preferences.
- Modify data filter preferences.
- Get current preferences again.
Example 2
Summary: Formats sales and employee data in a JMP data table, utilizing thousands separators and retrieving preferences.
Code:
dt = Open("data_table.jmp");
f = Char( Column( "sales($M)" ) << Get Format );
f = Char( Column( "#Employees" ) << Get Format );
Pref( Use thousands separator( 0 ) );
Column( "sales($M)" ) << Format( "use thousands separator" );
Column( "#Employees" ) << Format( "use thousands separator" );
f = Char( Column( "sales($M)" ) << Get Format );
f = Char( Column( "#Employees" ) << Get Format );
post pref = Get Preferences( Use thousands separator );
current preferences = Get Preferences();
Code Explanation:
- Open data table;
- Get sales format.
- Get employees format.
- Disable thousands separator.
- Set sales format to thousands.
- Set employees format to thousands.
- Get updated sales format.
- Get updated employees format.
- Retrieve post-pref settings.
- Get current preferences.
Preferences using Delete Rows
Summary: Prepares data by opening a data table, deleting rows and columns, and configuring export settings.
Code:
dt = Open("data_table.jmp");
dt << Delete Rows( 121 :: 240 );
dt << Delete Columns( "Phase" );
Preferences( Export Settings( End Of Field( Other( "/" ) ) ) );
Code Explanation:
- Open data table;
- Delete rows 121 to 240.
- Remove "Phase" column.
- Set export field delimiter to "/".