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

JSL - Histograms Control where and how to place them in a Journal

I lied... one more question :)

 

I am trying to add a histogram with a fitted normal distribution to my Journal, and I am running into a couple of issues.  Here is the code that I am using to create the histogram:

 

Distribution(
	Continuous Distribution(
		Column( :Score 1 ),
		Horizontal Layout( 1 ),
		Vertical( 0 ),
		Set Bin Width( 0.2 ),
		Fit Distribution( Normal )
	),
	Histograms Only,
	SendToReport(
		Dispatch(
			{"Score 1"},
			"1",
			ScaleBox,
			{Min( -0.323505454261101 ), Max( 1.8235054542611 ), Inc( 0.2 ),
			Minor Ticks( 0 )}
		),
		Dispatch(
			{"Score 1"},
			"Distrib Histogram",
			FrameBox,
			{Frame Size( 382, 217 )}
		),
		Dispatch( {"Score 1"}, "Fitted Normal", OutlineBox, {Close( 1 )} )
	)
);

So when I run this it puts the result in a newly created Journal in a hierarchy of Distributions > Score 1.  Here is what I would like to do and I have questions about:

 

1) When I make the histogram, how can I attach this to an already created Journal by attaching it to an H List Box or is there a different trick?

2) When I do the code above, it automatically adds the Parameter Estimates from the Fitted Normal, can I suppress this output?

3) Is it possible to get "count" on the y-axis on the Histogram?

 

Thank you in advance, have a good holiday.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: JSL - Histograms Control where and how to place them in a Journal

1. The << Journal message to the Distribution platform will automatically append it to the open journal.

 

2. You can use the use the << Delete message to that outline before journaling the platform. See below example.

 

3. Use Count Axis( 1 ) option when launching the platform or send the << Count Axis( 1 ) message to the platform after launch.

 

Example:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// launch platform with desired options
dist = dt << Distribution(
	Continuous Distribution(
		Column( :height ),
		Horizontal Layout( 1 ),
		Vertical( 0 ),
		Count Axis( 1 ),
		Fit Distribution( Normal )
	)
);

// obtain reference to the report layer
distr = dist << Report;

// remove the parameter estimates from the report
distr["Parameter Estimates"] << Delete;

// append report layer to curent (open) journal
dist << Journal;

 

View solution in original post

3 REPLIES 3

Re: JSL - Histograms Control where and how to place them in a Journal

1. The << Journal message to the Distribution platform will automatically append it to the open journal.

 

2. You can use the use the << Delete message to that outline before journaling the platform. See below example.

 

3. Use Count Axis( 1 ) option when launching the platform or send the << Count Axis( 1 ) message to the platform after launch.

 

Example:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// launch platform with desired options
dist = dt << Distribution(
	Continuous Distribution(
		Column( :height ),
		Horizontal Layout( 1 ),
		Vertical( 0 ),
		Count Axis( 1 ),
		Fit Distribution( Normal )
	)
);

// obtain reference to the report layer
distr = dist << Report;

// remove the parameter estimates from the report
distr["Parameter Estimates"] << Delete;

// append report layer to curent (open) journal
dist << Journal;

 

drblove
Level III

Re: JSL - Histograms Control where and how to place them in a Journal

Hi Mark,

 

Thank you for this answer it is working well for me.  I have a silly follow up question.  When this goes into the Journal it is in header of Distribution >> Score 1 - Score 1 is the name of the column.  I want to change the name Score 1 for the Journal to some thing else like "Histogram of Score 1 Data", how do I do this?

 

Thank you!

Brad

ian_jmp
Level X

Re: JSL - Histograms Control where and how to place them in a Journal

Add this line to Mark's code above (after the first occurance of 'distr'(:

distr[OutlineBox(1)] << setTitle("Histogram of Height Data");)