How can I automatically adjust bin width in distributions based on the data range itself?When I use the distribution platform, by default the bin width are always big and do not help gaining a good understanding of the distribution. The data I have to process vary in orders of maginutes (mega, mili, unit, etc) therefore a fixed bin with for all histograms do not work. Also in the real case that I need to process I have hundreds of tests so it is also not feasible to adjust the plots one by one. Is there a way to make the bin width for each individual plot be determined by the data range? For example I would like to simply grab the range and divide it in 100 equal parts or 50, etc. so regardless of the unit the appearance would be somewhat uniform across all plots without having to individually adjust them. Attached are 3 examples of plots where I wish the default would be to see bin width be set as perhaps 1/100 of the data range.
Thanks!
GraphicsRe: How can I automatically adjust bin width in distributions based on the data range itself?Hi @breino ,
start here:
https://community.jmp.com/t5/JMP-Add-Ins/2D-Histograms/ta-p/377945
let us know if it helps.
Re: How can I automatically adjust bin width in distributions based on the data range itself?Hello Ron:
Thank you for the suggestion. Unfortunately it does not like a large number of tests, I tried adding ~ 30 tests to be plotted and gives an error of "Cannot add item: list already contains maximum number of items."
I was hoping there was a general setting to adjust the bin width since most distributions come out with wide bars so that must be a global setting somewhere on how to determine how wide they are.
Re: How can I automatically adjust bin width in distributions based on the data range itself?You could try to script it.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Students.jmp");
colList = {"height", "weight"};
dist = dt << Distribution(
Continuous Distribution(Column(:height)),
Continuous Distribution(Column(:weight))
);
wait(2);
rep_layer = Report(dist);
axisbox = rep_layer[axis box(1)];
For Each({val}, colList,
//some calculation for inc
newInc = Col Max(Column(dt, val)) - Col Min(Column(dt, val));
newInc = newInc/10;
cur_rep = rep_layer[OutlineBox(val)];
axisbox = cur_rep[axis box(1)];
axisbox << Inc(newInc);
); There is also Bin Span() but I'm not sure if it can be modified after the distribution has been built.
Re: How can I automatically adjust bin width in distributions based on the data range itself?Hi @breino
how about this as a basis for development:
Open( "$SAMPLE_DATA/Big Class.jmp" );
Distribution(
Continuous Distribution( Column( :height ), Set Bin Width( (colmax(:height)-colmin(:height))/50 ) ),
Continuous Distribution( Column( :weight ), Set Bin Width( (colmax(:weight)-colmin(:weight))/100 ) )
);