Back in 2017, txnelson posted a nice snippet of code to do this:
<SPAN class="token function">Names Default To Here</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token number">1</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
dt <SPAN class="token operator">=</SPAN> <SPAN class="token function">Open</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"$SAMPLE_DATA\Big Class.jmp"</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
Dis <SPAN class="token operator">=</SPAN> dt <SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token messages"> Distribution</SPAN><SPAN class="token punctuation">(</SPAN>
Continuous Distribution<SPAN class="token punctuation">(</SPAN> <SPAN class="token function">Column</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">:</SPAN>height <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN> Vertical<SPAN class="token punctuation">(</SPAN> <SPAN class="token number">0</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN> Density Axis<SPAN class="token punctuation">(</SPAN> <SPAN class="token number">1</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token punctuation">)</SPAN>
<SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
<SPAN class="token function">Report</SPAN><SPAN class="token punctuation">(</SPAN> Dis <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">[</SPAN>Frame Box<SPAN class="token punctuation">(</SPAN> <SPAN class="token number">2</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">]</SPAN> <SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token messages"> Add Graphics Script</SPAN><SPAN class="token punctuation">(</SPAN>
mu <SPAN class="token operator">=</SPAN> <SPAN class="token number">63</SPAN><SPAN class="token punctuation">;</SPAN>
sigma <SPAN class="token operator">=</SPAN> <SPAN class="token number">3.2</SPAN><SPAN class="token punctuation">;</SPAN>
<SPAN class="token function">Pen Color</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"Red"</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
<SPAN class="token function">Y Function</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token function">Normal Density</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">(</SPAN>x <SPAN class="token operator">-</SPAN> mu<SPAN class="token punctuation">)</SPAN> <SPAN class="token operator">/</SPAN> sigma <SPAN class="token punctuation">)</SPAN> <SPAN class="token operator">/</SPAN> <SPAN class="token punctuation">(</SPAN><SPAN class="token number">40</SPAN> <SPAN class="token operator">/</SPAN> <SPAN class="token number">12</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN> x <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
mu <SPAN class="token operator">=</SPAN> <SPAN class="token number">51.5</SPAN><SPAN class="token punctuation">;</SPAN>
sigma <SPAN class="token operator">=</SPAN> <SPAN class="token punctuation">.</SPAN><SPAN class="token number">87</SPAN><SPAN class="token punctuation">;</SPAN>
<SPAN class="token function">Pen Color</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"Blue"</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
<SPAN class="token function">Y Function</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token function">Normal Density</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">(</SPAN>x <SPAN class="token operator">-</SPAN> mu<SPAN class="token punctuation">)</SPAN> <SPAN class="token operator">/</SPAN> sigma <SPAN class="token punctuation">)</SPAN> <SPAN class="token operator">/</SPAN> <SPAN class="token punctuation">(</SPAN><SPAN class="token number">40</SPAN> <SPAN class="token operator">/</SPAN> <SPAN class="token number">2</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN> x <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
<SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;<BR /></SPAN>
To scale the curve properly, you need the total number of data points divided by the data points for the maximum bar in the histogram distribution (here shown as 40/12 and 40/2) . Is there a way to calculate these? I can get the former, but not the latter.
Thanks for any help,
John
I do not know how to get the counts but assuming that the scale is appropriate, you could ask the Axis Box for the Maximum scale value with the << Get Max message.