cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
rbeckman
Level I

V Box List and H Box List Chart Layout

Hi.  I am a new user to JSL and this forum.  I use JMP9.

I would like to create graphs that are shown horizontally by chart type, and vertically by group.  This is the default display for JMP, but I am having trouble generating a script to do this for an unspecified number of groups.

Below is a simple script to generate the charts I would like.  How can I write a script to do this for an unspecified number of groups ("age" in this case)?  Is there a more clever way to do this?

Thanks.

<!--
dt = Open( "$SAMPLE_DATA/Big Class.JMP" );

New Window( "Big Class - Oneway",
V List Box(
  H List Box(
   Bivariate( Y( :height ), X( :weight ), Where( :age == 12 ) ),
   Oneway(
    Y( :height ),
    X( :sex ),
    All Graphs( 0 ),
    Means and Std Dev( 1 ),
    Plot Quantile by Actual( 1 ),
    Line of Fit( 0 ),
    Box Plots( 1 ),
    Mean Lines( 1 ),
    Mean CI Lines( 1 ),
    Mean Diamonds( 1 ),
    Mean Error Bars( 1 ),
    Std Dev Lines( 1 ),
    X Axis Proportional( 0 ),
    Points Jittered( 1 ),
    Points Spread( 1 ),
    Grand Mean( 0 ),
    Where( :age == 12 )
   )
  ),
  H List Box(
   Bivariate( Y( :height ), X( :weight ), Where( :age == 13 ) ),
   Oneway(
    Y( :height ),
    X( :sex ),
    All Graphs( 0 ),
    Means and Std Dev( 1 ),
    Plot Quantile by Actual( 1 ),
    Line of Fit( 0 ),
    Box Plots( 1 ),
    Mean Lines( 1 ),
    Mean CI Lines( 1 ),
    Mean Diamonds( 1 ),
    Mean Error Bars( 1 ),
    Std Dev Lines( 1 ),
    X Axis Proportional( 0 ),
    Points Jittered( 1 ),
    Points Spread( 1 ),
    Grand Mean( 0 ),
    Where( :age == 13 )
   )
  ),
  H List Box(
   Bivariate( Y( :height ), X( :weight ), Where( :age == 14 ) ),
   Oneway(
    Y( :height ),
    X( :sex ),
    All Graphs( 0 ),
    Means and Std Dev( 1 ),
    Plot Quantile by Actual( 1 ),
    Line of Fit( 0 ),
    Box Plots( 1 ),
    Mean Lines( 1 ),
    Mean CI Lines( 1 ),
    Mean Diamonds( 1 ),
    Mean Error Bars( 1 ),
    Std Dev Lines( 1 ),
    X Axis Proportional( 0 ),
    Points Jittered( 1 ),
    Points Spread( 1 ),
    Grand Mean( 0 ),
    Where( :age == 14 )
   )
  ),
  H List Box(
   Bivariate( Y( :height ), X( :weight ), Where( :age == 15 ) ),
   Oneway(
    Y( :height ),
    X( :sex ),
    All Graphs( 0 ),
    Means and Std Dev( 1 ),
    Plot Quantile by Actual( 1 ),
    Line of Fit( 0 ),
    Box Plots( 1 ),
    Mean Lines( 1 ),
    Mean CI Lines( 1 ),
    Mean Diamonds( 1 ),
    Mean Error Bars( 1 ),
    Std Dev Lines( 1 ),
    X Axis Proportional( 0 ),
    Points Jittered( 1 ),
    Points Spread( 1 ),
    Grand Mean( 0 ),
    Where( :age == 15 )
   )
  ),
  H List Box(
   Bivariate( Y( :height ), X( :weight ), Where( :age == 16 ) ),
   Oneway(
    Y( :height ),
    X( :sex ),
    All Graphs( 0 ),
    Means and Std Dev( 1 ),
    Plot Quantile by Actual( 1 ),
    Line of Fit( 0 ),
    Box Plots( 1 ),
    Mean Lines( 1 ),
    Mean CI Lines( 1 ),
    Mean Diamonds( 1 ),
    Mean Error Bars( 1 ),
    Std Dev Lines( 1 ),
    X Axis Proportional( 0 ),
    Points Jittered( 1 ),
    Points Spread( 1 ),
    Grand Mean( 0 ),
    Where( :age == 16 )
   )
  ),
  H List Box(
   Bivariate( Y( :height ), X( :weight ), Where( :age == 17 ) ),
   Oneway(
    Y( :height ),
    X( :sex ),
    All Graphs( 0 ),
    Means and Std Dev( 1 ),
    Plot Quantile by Actual( 1 ),
    Line of Fit( 0 ),
    Box Plots( 1 ),
    Mean Lines( 1 ),
    Mean CI Lines( 1 ),
    Mean Diamonds( 1 ),
    Mean Error Bars( 1 ),
    Std Dev Lines( 1 ),
    X Axis Proportional( 0 ),
    Points Jittered( 1 ),
    Points Spread( 1 ),
    Grand Mean( 0 ),
    Where( :age == 17 )
   )
  )
)
);
-->

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

V Box List and H Box List Chart Layout

One approach is to use a for-loop to populate the window by re-using expressions for the graphs appending them, in this case, in pairs. See the example script below.

dt = Open( "$SAMPLE_DATA/Big Class.JMP" );

// list of unique values

g = Associative Array( :age << get values ) << get keys;

// Graph Expressions

bivexpr = Expr(

          Bivariate( Y( :height ), X( :weight ), Where( :age == Expr( g[i] ) ) )

);

owexpr = Expr(

          Oneway(

                    Y( :height ),

                    X( :sex ),

                    All Graphs( 0 ),

                    Means and Std Dev( 1 ),

                    Plot Quantile by Actual( 1 ),

                    Line of Fit( 0 ),

                    Box Plots( 1 ),

                    Mean Lines( 1 ),

                    Mean CI Lines( 1 ),

                    Mean Diamonds( 1 ),

                    Mean Error Bars( 1 ),

                    Std Dev Lines( 1 ),

                    X Axis Proportional( 0 ),

                    Points Jittered( 1 ),

                    Points Spread( 1 ),

                    Grand Mean( 0 ),

                    Where( :age == Expr( g[i] ) )

          )

);

 

// Make new window

New Window( "Big Class - Oneway", vlb = V List Box() );

// Populate window iteratively

For( i = 1, i <= N Items( g ), i++,

          vlb << append(

  H List Box(

                              Eval( Eval Expr( bivexpr ) ),

                              Eval( Eval Expr( owexpr ) )

                    )

          )

);

View solution in original post

2 REPLIES 2
ms
Super User (Alumni) ms
Super User (Alumni)

V Box List and H Box List Chart Layout

One approach is to use a for-loop to populate the window by re-using expressions for the graphs appending them, in this case, in pairs. See the example script below.

dt = Open( "$SAMPLE_DATA/Big Class.JMP" );

// list of unique values

g = Associative Array( :age << get values ) << get keys;

// Graph Expressions

bivexpr = Expr(

          Bivariate( Y( :height ), X( :weight ), Where( :age == Expr( g[i] ) ) )

);

owexpr = Expr(

          Oneway(

                    Y( :height ),

                    X( :sex ),

                    All Graphs( 0 ),

                    Means and Std Dev( 1 ),

                    Plot Quantile by Actual( 1 ),

                    Line of Fit( 0 ),

                    Box Plots( 1 ),

                    Mean Lines( 1 ),

                    Mean CI Lines( 1 ),

                    Mean Diamonds( 1 ),

                    Mean Error Bars( 1 ),

                    Std Dev Lines( 1 ),

                    X Axis Proportional( 0 ),

                    Points Jittered( 1 ),

                    Points Spread( 1 ),

                    Grand Mean( 0 ),

                    Where( :age == Expr( g[i] ) )

          )

);

 

// Make new window

New Window( "Big Class - Oneway", vlb = V List Box() );

// Populate window iteratively

For( i = 1, i <= N Items( g ), i++,

          vlb << append(

  H List Box(

                              Eval( Eval Expr( bivexpr ) ),

                              Eval( Eval Expr( owexpr ) )

                    )

          )

);

rbeckman
Level I

V Box List and H Box List Chart Layout

Works great.  Thanks!