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
david707
Level III

Syntax and meaning of numbers in a DispatchSeg( Hist Seg( 1 ), Bin Span( x, y ) ) command

Hi,

 

I am trying to adjust the bin sizes of the histogram in a oneway analysis report, I am aware that this has been asked and answered before and you need to use:

DispatchSeg( Hist Seg( 1 ), Bin Span( x, y )) 

However, previous answers say to look at the scripting index for more information, and I cannot find anything about this on the scripting index.

I cannot figure out how x and y actually relate to the bin sizes, and how to get the sensible bin sizes I want.

Can someone please clarify exactly how x and y effect the bin sizes?

 

Thanks

3 REPLIES 3

Re: Syntax and meaning of numbers in a DispatchSeg( Hist Seg( 1 ), Bin Span( x, y ) ) command

Through a bit of trial and error, I've come to the conclusion that Bin Span (x, y) works out to:

x = the size of each bin; same function as using the hand tool and dragging horizontally

y = the offset of each bin; same function as using the hand tool and dragging vertically

(This holds true for the ANOVA platform--I didn't check with other histograms)

 

The code below demonstrates this with the Big Class sample file.

Names Default To Here (1);

dt = open ("$SAMPLE_DATA/big class.jmp");

//a bin for each data point
Oneway(
	Y( :weight ),
	X( :age ),
	Histograms( 1 ),
	SendToReport(
		Dispatch(
			{},
			"Oneway Report",
			FrameBox,
			{DispatchSeg( Hist Seg( 1 ), Bin Span( 1, 0 ) )}
		)
	)
);
//huge bin
Oneway(
	Y( :weight ),
	X( :age ),
	Histograms( 1 ),
	SendToReport(
		Dispatch(
			{},
			"Oneway Report",
			FrameBox,
			{DispatchSeg( Hist Seg( 1 ), Bin Span( 100, 0 ) )}
		)
	)
);

//medium bins with some offset
Oneway(
	Y( :weight ),
	X( :age ),
	Histograms( 1 ),
	SendToReport(
		Dispatch(
			{},
			"Oneway Report",
			FrameBox,
			{DispatchSeg( Hist Seg( 1 ), Bin Span( 10, 50 ) )}
		)
	)
);

 

david707
Level III

Re: Syntax and meaning of numbers in a DispatchSeg( Hist Seg( 1 ), Bin Span( x, y ) ) command

I guess my question is how does "size" relate to the data set and/or axis?

It seems really arbitrary with different data sets and axis.

Size 10 might look great on one graph and terrible on another.

Re: Syntax and meaning of numbers in a DispatchSeg( Hist Seg( 1 ), Bin Span( x, y ) ) command

>>It seems really arbitrary with different data sets and axis.

I completely agree. This Wikipedia article has about 10 different "rules of thumb" for determining bin sizes. In my experience, I've generally just accepted what JMP offers, and if I have questions about the shape, I switch to a Shadowgram, which avoids the bin size question altogether.