Yngeinstn,
I was under the impression you wanted the same scale for all distributions. JMP Distribution typically does an excellent job to scale the histograms to the data at hand. However, when you are plotting subsets of the data, the scale of the individual histograms will be different. If you know the range of the data, then assign the values for Lo, Hi and inc. If you want the script to handle data whose range could change with a process change or ?? then computing a Lo and Hi and inc should be a task of the script.
For the previous script, I just used the min and the max of the unexcluded data.
Lo = Floor( Col Minimum ( :test_2 * If( Excluded(), Empty(), 1 ) ) );
Hi = Ceiling( Col Maximum( :test_2 * If( Excluded(), Empty(), 1 ) ) );
Below, I made another modification to give some space on the ends: compute the std dev of the unexcluded data and add a half std deviation. One of the reasons, I proposed the alternative graphs that compare the distributions is that JMP will scale to all the included data and you can see the effects of channel and test state.
dt = Current Data Table();
jjrn3 = New Window( "Distribution [test_2]", <<Journal );
dtsum = dt << Summary( Group( :Channel, :Test State ), invisible );
Current Data Table( dt );
std = Col Std Dev(:test_2 * If( Excluded(), Empty(), 1 ));
Lo = Floor( Col Minimum( :test_2 * If( Excluded(), Empty(), 1 ) )
- 0.5 * std );
Hi = Ceiling( Col Maximum( :test_2 * If( Excluded(), Empty(), 1 ) )
+ .5 *std );
_yscl = gd_inc( Lo, Hi, 10 );
current data table(dt);
For( i = 1, i <= N Row( dtsum ), i++,
chnl = dtsum:Channel[i];
tst = dtsum:Test State[i];
gb = dt << Distribution(
where( dt:Channel == chnl & dt:Test State == tst ),
Stack( 1 ),
Continuous Distribution(
Column( :test_2 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Fit Distribution( Normal )
)
);
(gb << top Report)[TextBox(1)] << delete; //delete the where statement
report(gb)[OutlineBox(1)] << set title( EvalInsert("Results for IRL @ Channel=^chnl^ and Test State=^tst^"));
_xx = gb<< Xpath("//ScaleBox[@charID='1']");
_xx << Axis Setings({Min( Lo ), Max( Hi ), Inc( _yscl[1] ), Minor Ticks( 1 ),
Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )});
/*
If( i == 1,
gb << Save Presentation( "$TEMP/jmp_example2.pptx" ),
gb << Save Presentation( "$TEMP/jmp_example2.pptx", Append )
);
*/
gb<< Journal Window();
wait(0);
gb << close window();
);
There are multiple methods to automatically scale, and automatically find and eliminate outliers. I am reluctant to strongly recommend because methods accepted by one industry might not be acceptable to another; and normal data methods typically do not apply for lumpy data (clustered data or spatial data) or zero inflated defect data or reliability data. My intent is to point out alternatives that might or might not work for you.