cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
miguello
Level VI

Changing titles for Variability Charts with ByGroups using JSL

I have a script that plots Variability Chart by some group.

 

rep=Variability Chart(

    Y( :Name( "MyY" ) ),

    X(

          :Name("MyX1"),

          :Name( "MyX2" )

    ),

    Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ),

    By (:Name("ByGroup")));

 

Then I'm getting a plot for each ByGroup with two bars: "Variability Gauge ByGroup=group1" and "Variability Chart for MyY".

I found how to change the title of the second one to  just "MyY". But I cannot find hot to change title of the first one to only reflect ByGroup.

I can refer it one by one, if I know all the ByGroups, explicitly, but I don't want to hardcode all the ByGroups.

I was hoping for something like wildcarding and replacing title like this:

 

SendToReport(

           Dispatch(

                {},

                "Variability Gauge ByGroup=?",

                OutlineBox,

                {Set Title( :Name("ByGroup") )}

           ),

 

 

But it's not working. Any ideas how to make it work?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Changing titles for plots

I believe the issue you are having is that each By Group is handled as a separate tree structure under report(rep).  Therefore, for each of the By Groups, you have an Outline Box(1) and an Outline Box(2).

 

To change the title of the outline box for the title Variability Gauge ByGroups and the Variability Chart for MyY titles  you can do it with the following

 

 

Names Default To Here( 1 );

dt = Current Data Table(); 

rep = Variability Chart(

       Y( :Name( "MyY" ) ),

       X( :Name( "MyX1" ), :Name( "MyX2" ) ) ,

       Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ), 

       By( :Name( "ByGroup" ) ) 

);

 

Report( rep[1] )[Outline Box( 1 )] << set title( "The By line for group 1" );

Report( rep[1] )[Outline Box( 2 )] << set title( "The Variability Chart title for group 1" );

Report( rep[2] )[Outline Box( 1 )] << set title( "The By line for group 2" );

Report( rep[2] )[Outline Box( 2 )] << set title( "The Variability Chart title for group 2" );

 

 

 

Jim

View solution in original post

2 REPLIES 2

Re: Changing titles for plots

Miguello,

When I've done this I've used and expression with a string.  Build the string with the grouping name, substitute into the expression, then evaluate the expression.  There might be another way to do this, but that way has consistently worked for me in the past.

Mest,

M

txnelson
Super User

Re: Changing titles for plots

I believe the issue you are having is that each By Group is handled as a separate tree structure under report(rep).  Therefore, for each of the By Groups, you have an Outline Box(1) and an Outline Box(2).

 

To change the title of the outline box for the title Variability Gauge ByGroups and the Variability Chart for MyY titles  you can do it with the following

 

 

Names Default To Here( 1 );

dt = Current Data Table(); 

rep = Variability Chart(

       Y( :Name( "MyY" ) ),

       X( :Name( "MyX1" ), :Name( "MyX2" ) ) ,

       Analysis Type( Name( "Choose best analysis (EMS REML Bayesian)" ) ), 

       By( :Name( "ByGroup" ) ) 

);

 

Report( rep[1] )[Outline Box( 1 )] << set title( "The By line for group 1" );

Report( rep[1] )[Outline Box( 2 )] << set title( "The Variability Chart title for group 1" );

Report( rep[2] )[Outline Box( 1 )] << set title( "The By line for group 2" );

Report( rep[2] )[Outline Box( 2 )] << set title( "The Variability Chart title for group 2" );

 

 

 

Jim