All that has to be done to take the data table as you describe it, and pass it to Graph Builder to create the display you want it to stack the data and then run the Graph Builder. To illustrate, given the following table with 4 continuous variables(it could have as many continuous variables as needed),
One just uses
Tables=>Stack
and stacks all of the continuous columns, and also makes sure the Group column is also carried along
I have also renamed the Stacked Data Column to Measurement and the Source Label Column to Variable
Now the resulting data can be used by Graph Builder to create the desired graph
Below is a script that first creates the sample data table from one of the sample data tables supplied by JMP, then it stacks the data, and finally it uses Graph Builder to create the above chart
Names default to here(1);
// Create a sample data table that has multiple continuous variables with 2 groups
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
dt:Site << set name("Group");
dt << select where( :Group<=2 & :lot_id == "lot01" );
dt << invert row selection;
dt << delete rows;
dtSub = dt << Subset(
All rows,
columns( :Group, :NPN1, :NPN2, :NPN3, :NPN4 )
);
close(dt, nosave);
Wait(5); // Wait 5 seconds so one can see the initial data table
// Now just modify the data shape to set it up for Graph Builder to display the
// data as required
// First Stack all of the continuous variables into one column, and create a second
// column that indicates what column each row's value came from
dtStack = dtSub <<
Stack(
columns( :NPN1, :NPN2, :NPN3, :NPN4 ),
Source Label Column( "Variable" ),
Stacked Data Column( "Measurement" )
);
// Now graph the data placing the Variable and Group columns on the X axis and the
// Measurement column on the Y axis
// Also, remove the label from the Y axis
Graph Builder(
Size( 528, 458 ),
Show Control Panel( 0 ),
Variables(
X( :Variable ),
X( :Group, Position( 1 ) ),
Y( :Measurement ),
Color( :Group )
),
Elements(
Contour( X( 1 ), X( 2 ), Y, Legend( 14 ) ),
Box Plot( X( 1 ), X( 2 ), Y, Legend( 13 ) ),
Points( X( 1 ), X( 2 ), Y, Legend( 15 ) )
),
SendToReport(
Dispatch( {}, "Y title", TextEditBox, {Set Text( "" )} ),
Dispatch(
{},
"Graph Builder",
FrameBox,
{DispatchSeg( Poly Seg( "Violin (NPN1>>1)" ), {Transparency( 0.5 )} ),
DispatchSeg( Poly Seg( "Violin (NPN1>>2)" ), {Transparency( 0.5 )} ),
DispatchSeg( Poly Seg( "Violin (NPN2>>1)" ), {Transparency( 0.5 )} ),
DispatchSeg( Poly Seg( "Violin (NPN2>>2)" ), {Transparency( 0.5 )} ),
DispatchSeg( Poly Seg( "Violin (NPN3>>1)" ), {Transparency( 0.5 )} ),
DispatchSeg( Poly Seg( "Violin (NPN3>>2)" ), {Transparency( 0.5 )} ),
DispatchSeg( Poly Seg( "Violin (NPN4>>1)" ), {Transparency( 0.5 )} ),
DispatchSeg( Poly Seg( "Violin (NPN4>>2)" ), {Transparency( 0.5 )} )}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {14, [3, 4], 13, [0, 1, 2, -3], 15, [5, 6]} )}
)
)
);
Jim