@gzmorgan0 wrote:
Thank you, Dan. I never investigated Float bar type. Your post got me thinking of alternative methods to add the means and hav them appear at the bottom or the top of the graph.
One method was interesting but messy and changed the original table. [See *** below]. Then I notoced that JMP has a new element called a Caption Box. It is very cool, but each Caption Box seems to allow only one caption per FrameBox. This can be easy by making the categorical X-axis the X Group variable. See the picture and script. However, now the connected means gets tough. This might be a nice wish list item for future versions: add a caption box option for nominal X-axis plots. So for boxplots, one option could be the Five number Summary another N, Mean, Std dev.
@gzmorgan0 wrote:
Thank you, Dan. I never investigated Float bar type. Your post got me thinking of alternative methods to add the means and hav them appear at the bottom or the top of the graph.
One method was interesting but messy and changed the original table. [See *** below]. Then I notoced that JMP has a new element called a Caption Box. It is very cool, but each Caption Box seems to allow only one caption per FrameBox. This can be easy by making the categorical X-axis the X Group variable. See the picture and script. However, now the connected means gets tough. This might be a nice wish list item for future versions: add a caption box option for nominal X-axis plots. So for boxplots, one option could be the Five number Summary another N, Mean, Std dev.
gb2 = dt << Graph Builder(
Size( 1065, 516 ),
Show Control Panel( 0 ),
Variables( Y( :Sales ), Group X( :Month ) ),
Elements(
Box Plot( Y, Legend( 6 ), Box Style( "Solid" ) ),
Line( Y, Legend( 7 ) ),
Caption Box( Y, Legend( 9 ) )
),
SendToReport(
Dispatch(
{},
"Sales",
ScaleBox,
{Min( 50 ), Max( 700 ), Inc( 100 ), Minor Ticks( 1 )}
),
)
);
bpseg = gb2 << Xpath("//BoxPlotSeg");
bpseg << {Box Style( "Solid" ), Confidence Diamond( 1 ), Fences( 0 )};
//if you want to color each by month
for(i=1, i<=nitems(bpseg), i++,
bpseg[i] << Fill Color(Color Of(As Row State(cc[i])))
);
The full script is attached.
***Method takes some work all UI. I might do this once. Scripting seems easier, especially if the Caption Box wish
- Concatenate the original table and the table summary.
- Add a column called Means that is really the positon where you want the means to appear.
- Make the Mean(Sales) column a label.
- Plot both Sales and Means versus Month
- Move Mean sales to the right and align tick marks
- Make the changes as shown previously for the left axis (chaging points to the boxplot, add a line)
- Change the Points on the right to a bar style single and Label ("Label by Row")
You can add as much caption boxes as you want by drag & drop. By default they are displaying the mean. This however can be changed to Std Dev, N etc.
However, in case of the mean, I prefer to show him at the box plot.
gb2 = dt << Graph Builder(
Size( 1065, 516 ),
Show Control Panel( 0 ),
Variables( Y( :Sales ), Group X( :Month ) ),
Elements(
Box Plot( Y, Legend( 6 ), Box Style( "Solid" ) ),
Line( Y, Legend( 7 ) ),
Caption Box( Y, Legend( 9 ) )
),
SendToReport(
Dispatch(
{},
"Sales",
ScaleBox,
{Min( 50 ), Max( 700 ), Inc( 100 ), Minor Ticks( 1 )}
),
)
);
bpseg = gb2 << Xpath("//BoxPlotSeg");
bpseg << {Box Style( "Solid" ), Confidence Diamond( 1 ), Fences( 0 )};
//if you want to color each by month
for(i=1, i<=nitems(bpseg), i++,
bpseg[i] << Fill Color(Color Of(As Row State(cc[i])))
);
The full script is attached.
***Method takes some work all UI. I might do this once. Scripting seems easier, especially if the Caption Box wish
- Concatenate the original table and the table summary.
- Add a column called Means that is really the positon where you want the means to appear.
- Make the Mean(Sales) column a label.
- Plot both Sales and Means versus Month
- Move Mean sales to the right and align tick marks
- Make the changes as shown previously for the left axis (chaging points to the boxplot, add a line)
- Change the Points on the right to a bar style single and Label ("Label by Row")